diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2009-03-11 15:07:44 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2009-03-11 15:07:44 +0000 |
commit | 4221e90ae468acc4b6c43faa36aee5160d2738c6 (patch) | |
tree | f9a100c67f7aff66cd948d6e85fa8bca6ac684ff /networking/ftpd.c | |
parent | a19e64933c600b7f05232ad80bb5db85c115e42d (diff) | |
download | busybox-w32-4221e90ae468acc4b6c43faa36aee5160d2738c6.tar.gz busybox-w32-4221e90ae468acc4b6c43faa36aee5160d2738c6.tar.bz2 busybox-w32-4221e90ae468acc4b6c43faa36aee5160d2738c6.zip |
ftpd: stop unconditional logging to syslog. This was the only applet
which was doing it. Added option -S to enable it when desired.
function old new delta
packed_usage 25647 25666 +19
ftpd_main 1826 1825 -1
Diffstat (limited to 'networking/ftpd.c')
-rw-r--r-- | networking/ftpd.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/networking/ftpd.c b/networking/ftpd.c index 29589d185..3faa3ed7d 100644 --- a/networking/ftpd.c +++ b/networking/ftpd.c | |||
@@ -80,7 +80,8 @@ enum { | |||
80 | OPT_l = (1 << 0), | 80 | OPT_l = (1 << 0), |
81 | OPT_1 = (1 << 1), | 81 | OPT_1 = (1 << 1), |
82 | OPT_v = (1 << 2), | 82 | OPT_v = (1 << 2), |
83 | OPT_w = (1 << 3), | 83 | OPT_S = (1 << 3), |
84 | OPT_w = (1 << 4), | ||
84 | 85 | ||
85 | #define mk_const4(a,b,c,d) (((a * 0x100 + b) * 0x100 + c) * 0x100 + d) | 86 | #define mk_const4(a,b,c,d) (((a * 0x100 + b) * 0x100 + c) * 0x100 + d) |
86 | #define mk_const3(a,b,c) ((a * 0x100 + b) * 0x100 + c) | 87 | #define mk_const3(a,b,c) ((a * 0x100 + b) * 0x100 + c) |
@@ -806,7 +807,7 @@ int ftpd_main(int argc, char **argv) | |||
806 | { | 807 | { |
807 | smallint opts; | 808 | smallint opts; |
808 | 809 | ||
809 | opts = getopt32(argv, "l1v" USE_FEATURE_FTP_WRITE("w")); | 810 | opts = getopt32(argv, "l1vS" USE_FEATURE_FTP_WRITE("w")); |
810 | 811 | ||
811 | if (opts & (OPT_l|OPT_1)) { | 812 | if (opts & (OPT_l|OPT_1)) { |
812 | /* Our secret backdoor to ls */ | 813 | /* Our secret backdoor to ls */ |
@@ -828,11 +829,13 @@ int ftpd_main(int argc, char **argv) | |||
828 | * failure */ | 829 | * failure */ |
829 | } | 830 | } |
830 | 831 | ||
831 | /* LOG_NDELAY is needed since we may chroot later */ | ||
832 | openlog(applet_name, LOG_PID | LOG_NDELAY, LOG_DAEMON); | ||
833 | logmode |= LOGMODE_SYSLOG; | ||
834 | if (!(opts & OPT_v)) | 832 | if (!(opts & OPT_v)) |
835 | logmode = LOGMODE_SYSLOG; | 833 | logmode = LOGMODE_NONE; |
834 | if (opts & OPT_S) { | ||
835 | /* LOG_NDELAY is needed since we may chroot later */ | ||
836 | openlog(applet_name, LOG_PID | LOG_NDELAY, LOG_DAEMON); | ||
837 | logmode |= LOGMODE_SYSLOG; | ||
838 | } | ||
836 | 839 | ||
837 | G.proc_self_fd = xopen("/proc/self", O_RDONLY | O_DIRECTORY); | 840 | G.proc_self_fd = xopen("/proc/self", O_RDONLY | O_DIRECTORY); |
838 | 841 | ||