summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-08-25 21:04:57 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-08-25 21:04:57 +0000
commit05a1c82cea94423f31eeffcde116ad3b225de98e (patch)
tree2ceb35615b84d8ae704ed41c80d2a086840aa218
parent0f3a85855080925e4c72178676a89f662f258030 (diff)
hide our base dir
-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.",