Path: blob/main/ftp/ftpproxy/files/patch-src_main.c
16461 views
--- src/main.c.orig 2023-02-20 11:38:18 UTC1+++ src/main.c2@@ -41,6 +41,7 @@3#include <arpa/inet.h>4#include <syslog.h>5#include <sys/time.h>6+#include <limits.h>78#include "ftp.h"9#include "ip-lib.h"10@@ -55,8 +56,11 @@111213char *program = "";14-char progname[80] = "";15+char progname[PATH_MAX] = "";1617+char pidfile[PATH_MAX];18+struct pidfh *pfh;19+20int debug = 0;21int extralog = 0;2223@@ -88,6 +92,8 @@ int main(int argc, char *argv[], char *envp[])24program = progname;25}2627+ copy_string(pidfile, PIDFILE_DEFAULT, sizeof(pidfile));28+29config = allocate(sizeof(config_t));30config->timeout = 15 * 60;31config->allow_passwdblanks = 0;32@@ -146,6 +152,12 @@ int main(int argc, char *argv[], char *envp[])33config->dataport = strtoul(argv[k++], NULL, 10);34if (config->dataport == 0)35config->dataport = 20;36+ }37+ else if (c == 'P') {38+ if (k >= argc)39+ missing_arg(c, "pid file name");40+41+ copy_string(pidfile, argv[k++], sizeof(pidfile));42}43else if (c == 'q') {44454647