summaryrefslogtreecommitdiff
path: root/libexec/ftpd/ftpd.c
diff options
context:
space:
mode:
Diffstat (limited to 'libexec/ftpd/ftpd.c')
-rw-r--r--libexec/ftpd/ftpd.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c
index 50a5135f9d4..e79d92e8878 100644
--- a/libexec/ftpd/ftpd.c
+++ b/libexec/ftpd/ftpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ftpd.c,v 1.15 1996/08/13 06:34:39 deraadt Exp $ */
+/* $OpenBSD: ftpd.c,v 1.16 1996/08/25 21:04:56 deraadt Exp $ */
/* $NetBSD: ftpd.c,v 1.15 1995/06/03 22:46:47 mycroft Exp $ */
/*
@@ -797,11 +797,15 @@ skip:
reply(550, "Can't set guest privileges.");
goto bad;
}
+ strcpy(pw->pw_dir, "/");
+ setenv("HOME", "/", 1);
} else if (dochroot) {
if (chroot(rootdir) < 0 || chdir("/") < 0) {
reply(550, "Can't change root.");
goto bad;
}
+ strcpy(pw->pw_dir, "/");
+ setenv("HOME", "/", 1);
} else if (chdir(pw->pw_dir) < 0) {
if (chdir("/") < 0) {
reply(530, "User %s: can't change directory to %s.",