summaryrefslogtreecommitdiff
path: root/net-analyzer/authforce/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-02-10 21:05:55 +0000
committerV3n3RiX <venerix@redcorelinux.org>2020-02-10 21:05:55 +0000
commit71deace00d1a2b091313fe137ab7092418c6f87c (patch)
tree9f1f0dee23e13658e52f49437befe78427148c51 /net-analyzer/authforce/files
parent29aabba0ea759c6a2864ff5631735b67ee38e5e0 (diff)
gentoo resync : 10.02.2020
Diffstat (limited to 'net-analyzer/authforce/files')
-rw-r--r--net-analyzer/authforce/files/authforce-0.9.9-fix-parsing-of-sample-config-file.patch54
-rw-r--r--net-analyzer/authforce/files/authforce-0.9.9-fix-submit_dummy_list-re-declaration.patch25
-rw-r--r--net-analyzer/authforce/files/authforce-0.9.9-fixes-for-Wall-warnings.patch111
3 files changed, 190 insertions, 0 deletions
diff --git a/net-analyzer/authforce/files/authforce-0.9.9-fix-parsing-of-sample-config-file.patch b/net-analyzer/authforce/files/authforce-0.9.9-fix-parsing-of-sample-config-file.patch
new file mode 100644
index 000000000000..902b2a086e0d
--- /dev/null
+++ b/net-analyzer/authforce/files/authforce-0.9.9-fix-parsing-of-sample-config-file.patch
@@ -0,0 +1,54 @@
+From 294ef3529016c29769d10dee9e5f639c2ce02b91 Mon Sep 17 00:00:00 2001
+From: "Zachary P. Landau" <zlandau@jellofund.net>
+Date: Wed, 5 Feb 2020 23:18:31 -0800
+Subject: [PATCH 3/4] Fix parsing of sample config file
+
+This code is horribly broken, but we should at least be able to parse
+the authforcerc.sample file, and report the right line number when
+failing.
+---
+ src/config.c | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/src/config.c b/src/config.c
+index 4462fcc..66313d9 100644
+--- a/src/config.c
++++ b/src/config.c
+@@ -11,7 +11,7 @@
+ #endif /* MEMWATCH */
+ #include "extern.h"
+
+-#define BUFFER_LEN 82
++#define BUFFER_LEN 100
+ #define IS_BIT(x) (!strcmp(x, "0") || !strcmp(x, "1"))
+
+ static void process_boolean(char *option, char *value, int *variable) {
+@@ -30,7 +30,7 @@ void parse_config(char *config) {
+ char *option; /* config file option */
+ char *value; /* value for option */
+
+- int line_number = 1;
++ int line_number = 0;
+ char *chop;
+
+ /* MEMWATCH: reports this isnt freed, why? */
+@@ -45,6 +45,7 @@ void parse_config(char *config) {
+ }
+
+ while (fgets(buffer, sizeof(buffer), fp)) {
++ line_number++;
+ if (buffer[0] == '#' || buffer[0] == ';' || buffer[0] == '\n')
+ continue;
+ remove_crud(buffer);
+@@ -123,8 +124,6 @@ void parse_config(char *config) {
+ else
+ if (!quiet)
+ printf("parse_config: option %s is not valid\n", option);
+-
+- line_number++;
+ }
+
+ debug(3, "parse_config: read %s [%i]\n", config, line_number-1);
+--
+2.25.0
+
diff --git a/net-analyzer/authforce/files/authforce-0.9.9-fix-submit_dummy_list-re-declaration.patch b/net-analyzer/authforce/files/authforce-0.9.9-fix-submit_dummy_list-re-declaration.patch
new file mode 100644
index 000000000000..e6ca243fcad7
--- /dev/null
+++ b/net-analyzer/authforce/files/authforce-0.9.9-fix-submit_dummy_list-re-declaration.patch
@@ -0,0 +1,25 @@
+From d7f718e78444acef635acdd19e34dc4783e741fa Mon Sep 17 00:00:00 2001
+From: "Zachary P. Landau" <zlandau@jellofund.net>
+Date: Wed, 5 Feb 2020 23:00:06 -0800
+Subject: [PATCH 1/4] Fix submit_dummy_list re-declaration
+
+---
+ src/extern.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/extern.h b/src/extern.h
+index 6798bd7..cc08e0a 100644
+--- a/src/extern.h
++++ b/src/extern.h
+@@ -61,7 +61,7 @@ extern void initialize_submit(void);
+ extern int submit(char *username, char *password);
+ extern void shutdown_submit(void);
+ #ifdef USE_DUMMY
+-char **submit_dummy_list;
++extern char **submit_dummy_list;
+ #endif /* USE_DUMMY */
+
+ /* files.c */
+--
+2.25.0
+
diff --git a/net-analyzer/authforce/files/authforce-0.9.9-fixes-for-Wall-warnings.patch b/net-analyzer/authforce/files/authforce-0.9.9-fixes-for-Wall-warnings.patch
new file mode 100644
index 000000000000..083bb93d1296
--- /dev/null
+++ b/net-analyzer/authforce/files/authforce-0.9.9-fixes-for-Wall-warnings.patch
@@ -0,0 +1,111 @@
+From ef74da31208f1390bbc17d4c455c821f141ec78b Mon Sep 17 00:00:00 2001
+From: "Zachary P. Landau" <zlandau@jellofund.net>
+Date: Wed, 5 Feb 2020 23:17:50 -0800
+Subject: [PATCH 2/4] Fixes for -Wall warnings
+
+---
+ src/files.c | 10 +++++-----
+ src/http.c | 4 ----
+ src/methods.c | 4 ++--
+ 3 files changed, 7 insertions(+), 11 deletions(-)
+
+diff --git a/src/files.c b/src/files.c
+index 1068616..92d45ac 100644
+--- a/src/files.c
++++ b/src/files.c
+@@ -70,7 +70,7 @@ char **textlist(char *textfile) {
+
+ /* MEMWATCH: this isnt freed, why? */
+ wordlist[count] = malloc_w(sizeof(NULL));
+- wordlist[count] = (char)NULL;
++ wordlist[count] = NULL;
+
+ fclose(fp);
+
+@@ -83,7 +83,7 @@ char **copy_list(char **list) {
+ char **n_list; /* new list */
+
+ /* find num of elements */
+- while (list[i] != (char)NULL)
++ while (list[i] != NULL)
+ i++;
+ /* plus one for NULL */
+ i++;
+@@ -91,12 +91,12 @@ char **copy_list(char **list) {
+ n_list = malloc_w(i*sizeof(char*));
+
+ i=0;
+- while (list[i] != (char)NULL) {
++ while (list[i] != NULL) {
+ n_list[i] = (char*)strdup_w(list[i]);
+ i++;
+ }
+
+- n_list[i] = (char)NULL;
++ n_list[i] = NULL;
+
+ return (n_list);
+ }
+@@ -104,7 +104,7 @@ char **copy_list(char **list) {
+ void free_list(char **list) {
+ int i=0;
+
+- while (list[i] != (char)NULL) {
++ while (list[i] != NULL) {
+ free(list[i]);
+ i++;
+ }
+diff --git a/src/http.c b/src/http.c
+index 88acdfc..397ac1f 100644
+--- a/src/http.c
++++ b/src/http.c
+@@ -40,7 +40,6 @@ int submit(char *username, char *password) {
+ CURLcode result;
+ char error[CURL_ERROR_SIZE] = "";
+ char authstring[92];
+- time_t before, after;
+
+
+ num_connects++;
+@@ -59,8 +58,6 @@ int submit(char *username, char *password) {
+ } else
+ printf("trying %s->%s\n", username, password);
+
+- before = time(0);
+-
+ if (curl) {
+ curl_easy_setopt(curl, CURLOPT_URL, url);
+ curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, error);
+@@ -79,7 +76,6 @@ int submit(char *username, char *password) {
+ result = curl_easy_perform(curl);
+ }
+
+- after = time(0);
+ /* num_connects jumps the gun earlier on */
+ // acs = stats(acs, after-before, num_connects-1);
+
+diff --git a/src/methods.c b/src/methods.c
+index 3c74c65..bdb6efc 100644
+--- a/src/methods.c
++++ b/src/methods.c
+@@ -76,7 +76,7 @@ char *transform(char *username, char *password) {
+
+ strncpy(old_password, password, sizeof(char)*41);
+
+- while ((cur_element = elements[i]) != (char)NULL) {
++ while ((cur_element = elements[i]) != NULL) {
+ if (!strcmp(password, "{username}"))
+ strncpy(insertion, username, sizeof(insertion));
+ else if (!strcmp(password, "{emanresu}"))
+@@ -120,7 +120,7 @@ void common_pairs(void) {
+ }
+
+ while (1) {
+- if (common_pairs_list[i] == (char)NULL)
++ if (common_pairs_list[i] == NULL)
+ break;
+ strncpy(username, common_pairs_list[i], sizeof(char)*81);
+ password = extract(username, ':');
+--
+2.25.0
+