Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports-kde
Path: blob/main/ftp/ftpproxy/files/patch-src_main.c
16461 views
1
--- src/main.c.orig 2023-02-20 11:38:18 UTC
2
+++ src/main.c
3
@@ -41,6 +41,7 @@
4
#include <arpa/inet.h>
5
#include <syslog.h>
6
#include <sys/time.h>
7
+#include <limits.h>
8
9
#include "ftp.h"
10
#include "ip-lib.h"
11
@@ -55,8 +56,11 @@
12
13
14
char *program = "";
15
-char progname[80] = "";
16
+char progname[PATH_MAX] = "";
17
18
+char pidfile[PATH_MAX];
19
+struct pidfh *pfh;
20
+
21
int debug = 0;
22
int extralog = 0;
23
24
@@ -88,6 +92,8 @@ int main(int argc, char *argv[], char *envp[])
25
program = progname;
26
}
27
28
+ copy_string(pidfile, PIDFILE_DEFAULT, sizeof(pidfile));
29
+
30
config = allocate(sizeof(config_t));
31
config->timeout = 15 * 60;
32
config->allow_passwdblanks = 0;
33
@@ -146,6 +152,12 @@ int main(int argc, char *argv[], char *envp[])
34
config->dataport = strtoul(argv[k++], NULL, 10);
35
if (config->dataport == 0)
36
config->dataport = 20;
37
+ }
38
+ else if (c == 'P') {
39
+ if (k >= argc)
40
+ missing_arg(c, "pid file name");
41
+
42
+ copy_string(pidfile, argv[k++], sizeof(pidfile));
43
}
44
else if (c == 'q') {
45
46
47