diff options
Diffstat (limited to 'libexec/ftpd/ftpd.c')
-rw-r--r-- | libexec/ftpd/ftpd.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c index 9704f60..80af14f 100644 --- a/libexec/ftpd/ftpd.c +++ b/libexec/ftpd/ftpd.c @@ -126,6 +126,7 @@ int paranoid = 1; /* be extra careful about security */ int anon_only = 0; /* Only anonymous ftp allowed */ int guest; int dochroot; +int dowtmp = 1; int stats; int statfd = -1; int type; @@ -295,7 +296,7 @@ main(int argc, char *argv[], char **envp) #endif /* OLD_SETPROCTITLE */ - while ((ch = getopt(argc, argv, "46a:AdDElmMoOp:rRSt:T:u:Uv")) != -1) { + while ((ch = getopt(argc, argv, "46a:AdDElmMoOp:rRSt:T:u:UvW")) != -1) { switch (ch) { case '4': enable_v4 = 1; @@ -394,6 +395,10 @@ main(int argc, char *argv[], char **envp) ftpdebug++; break; + case 'W': + dowtmp = 0; + break; + default: warnx("unknown flag -%c ignored", optopt); break; @@ -1128,7 +1133,7 @@ end_login(void) #endif (void) seteuid((uid_t)0); - if (logged_in) + if (logged_in && dowtmp) ftpd_logwtmp(ttyline, "", NULL); pw = NULL; #ifdef LOGIN_CAP @@ -1413,7 +1418,9 @@ skip: #endif /* open wtmp before chroot */ - ftpd_logwtmp(ttyline, pw->pw_name, (struct sockaddr *)&his_addr); + if (dowtmp) + ftpd_logwtmp(ttyline, pw->pw_name, + (struct sockaddr *)&his_addr); logged_in = 1; if (guest && stats && statfd < 0) @@ -2463,7 +2470,7 @@ dologout(int status) */ transflag = 0; - if (logged_in) { + if (logged_in && dowtmp) { (void) seteuid((uid_t)0); ftpd_logwtmp(ttyline, "", NULL); } |