diff options
author | Carlo Landmeter <clandmeter@gmail.com> | 2013-01-04 22:49:25 +0100 |
---|---|---|
committer | Carlo Landmeter <clandmeter@gmail.com> | 2013-01-04 22:49:25 +0100 |
commit | f4487ef759ff869103ba36ba82d2366a373e600d (patch) | |
tree | da62a2a65b9a446192c11ad926e268a4369be3c0 /main/knock/path-max.patch | |
parent | aa04d0ad4e9f31c6bdfb2116609253d38bd9b383 (diff) | |
download | aports-f4487ef759ff869103ba36ba82d2366a373e600d.tar.bz2 aports-f4487ef759ff869103ba36ba82d2366a373e600d.tar.xz |
main/knock: fix build on eglibc
Diffstat (limited to 'main/knock/path-max.patch')
-rw-r--r-- | main/knock/path-max.patch | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/main/knock/path-max.patch b/main/knock/path-max.patch new file mode 100644 index 0000000000..d4c398dae5 --- /dev/null +++ b/main/knock/path-max.patch @@ -0,0 +1,75 @@ +--- knock-0.5.orig/src/knockd.c ++++ knock-0.5/src/knockd.c +@@ -131,9 +131,9 @@ + int o_daemon = 0; + int o_lookup = 0; + char o_int[32] = ""; /* default (eth0) is set after parseconfig() */ +-char o_cfg[PATH_MAX] = "/etc/knockd.conf"; +-char o_pidfile[PATH_MAX] = "/var/run/knockd.pid"; +-char o_logfile[PATH_MAX] = ""; ++char o_cfg[4096] = "/etc/knockd.conf"; ++char o_pidfile[4096] = "/var/run/knockd.pid"; ++char o_logfile[4096] = ""; + + int main(int argc, char **argv) + { +@@ -435,7 +435,7 @@ + int parseconfig(char *configfile) + { + FILE *fp = NULL; +- char line[PATH_MAX+1]; ++ char line[4096+1]; + char *ptr = NULL; + char *key = NULL; + int linenum = 0; +@@ -448,7 +448,7 @@ + return(1); + } + +- while(fgets(line, PATH_MAX, fp)) { ++ while(fgets(line, 4096, fp)) { + linenum++; + trim(line); + if(strlen(line) == 0 || line[0] == '#') { +@@ -509,12 +509,12 @@ + trim(ptr); + if(!strcmp(section, "options")) { + if(!strcmp(key, "LOGFILE")) { +- strncpy(o_logfile, ptr, PATH_MAX-1); +- o_logfile[PATH_MAX-1] = '\0'; ++ strncpy(o_logfile, ptr, 4096-1); ++ o_logfile[4096-1] = '\0'; + dprint("config: log file: %s\n", o_logfile); + } else if(!strcmp(key, "PIDFILE")) { +- strncpy(o_pidfile, ptr, PATH_MAX-1); +- o_pidfile[PATH_MAX-1] = '\0'; ++ strncpy(o_pidfile, ptr, 4096-1); ++ o_pidfile[4096-1] = '\0'; + dprint("config: pid file: %s\n", o_pidfile); + } else if(!strcmp(key, "INTERFACE")) { + /* set interface only if it has not already been set by the -i switch */ +@@ -692,11 +692,11 @@ + */ + long get_next_one_time_sequence(opendoor_t *door) + { +- char line[PATH_MAX+1]; ++ char line[4096+1]; + int pos; + + pos = ftell(door->one_time_sequences_fd); +- while(fgets(line, PATH_MAX, door->one_time_sequences_fd)) { ++ while(fgets(line, 4096, door->one_time_sequences_fd)) { + trim(line); + if(strlen(line) == 0 || line[0] == '#') { + pos = ftell(door->one_time_sequences_fd); +@@ -1382,8 +1382,8 @@ + /* run the associated command */ + if(fork() == 0) { + /* child */ +- char parsed_start_cmd[PATH_MAX]; +- char parsed_stop_cmd[PATH_MAX]; ++ char parsed_start_cmd[4096]; ++ char parsed_stop_cmd[4096]; + size_t cmd_len = 0; + + setsid(); |