aboutsummaryrefslogtreecommitdiff
path: root/libexec/ftpd
diff options
context:
space:
mode:
authorYaroslav Tykhiy <ytykhiy@gmail.com>2004-11-22 10:48:29 +0000
committerYaroslav Tykhiy <ytykhiy@gmail.com>2004-11-22 10:48:29 +0000
commite897216f4581a1508214066190cda714d884a052 (patch)
tree90b5850167a72130bb4c19e2a95083bf2fe60667 /libexec/ftpd
parent7cdd3cb70b238654bf6bee85fceb7340a584ad23 (diff)
Notes
Diffstat (limited to 'libexec/ftpd')
-rw-r--r--libexec/ftpd/ftpd.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c
index d6e3806e650b..c0ac3f342772 100644
--- a/libexec/ftpd/ftpd.c
+++ b/libexec/ftpd/ftpd.c
@@ -1589,6 +1589,8 @@ skip:
syslog(LOG_INFO, "FTP LOGIN FROM %s as %s",
remotehost, pw->pw_name);
}
+ if (guest || dochroot)
+ syslog(LOG_INFO, "session root changed to %s", chrootdir);
#ifdef LOGIN_CAP
login_close(lc);
#endif
@@ -3172,12 +3174,9 @@ logcmd(char *cmd, char *file1, char *file2, off_t cnt)
if (logging <= 1)
return;
- /* If either filename isn't absolute, get current dir for log message. */
- if ((file1 && file1[0] != '/') || (file2 && file2[0] != '/')) {
- if (getcwd(wd, sizeof(wd) - 1) == NULL)
- strcpy(wd, strerror(errno));
- } else
- wd[0] = '\0';
+
+ if (getcwd(wd, sizeof(wd) - 1) == NULL)
+ strcpy(wd, strerror(errno));
appendf(&msg, "%s", cmd);
if (file1)
@@ -3186,10 +3185,10 @@ logcmd(char *cmd, char *file1, char *file2, off_t cnt)
appendf(&msg, " %s", file2);
if (cnt >= 0)
appendf(&msg, " = %jd bytes", (intmax_t)cnt);
- if (wd[0])
- appendf(&msg, " (wd: %s)", wd);
+ appendf(&msg, " (wd: %s", wd);
if (guest || dochroot)
- appendf(&msg, " (chroot: %s)", chrootdir);
+ appendf(&msg, "; chrooted");
+ appendf(&msg, ")");
syslog(LOG_INFO, "%s", msg);
free(msg);
}