diff options
author | Damien Miller <djm@mindrot.org> | 2008-02-10 12:40:12 +0100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2008-02-10 12:40:12 +0100 |
commit | d8cb1f184f9acaae02bb4d15ce1e00ffbeeeac88 (patch) | |
tree | fb0100a74a6c870e835706aa487b54500510c5e1 /sftp-server.c | |
parent | - markus@cvs.openbsd.org 2008/02/04 21:53:00 (diff) | |
download | openssh-d8cb1f184f9acaae02bb4d15ce1e00ffbeeeac88.tar.xz openssh-d8cb1f184f9acaae02bb4d15ce1e00ffbeeeac88.zip |
- djm@cvs.openbsd.org 2008/02/08 23:24:07
[servconf.c servconf.h session.c sftp-server.c sftp.h sshd_config]
[sshd_config.5]
add sshd_config ChrootDirectory option to chroot(2) users to a directory
and tweak internal sftp server to work with it (no special files in
chroot required). ok markus@
Diffstat (limited to 'sftp-server.c')
-rw-r--r-- | sftp-server.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/sftp-server.c b/sftp-server.c index 373bd5eda..44ccefff8 100644 --- a/sftp-server.c +++ b/sftp-server.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sftp-server.c,v 1.76 2008/02/04 21:53:00 markus Exp $ */ +/* $OpenBSD: sftp-server.c,v 1.77 2008/02/08 23:24:07 djm Exp $ */ /* * Copyright (c) 2000-2004 Markus Friedl. All rights reserved. * @@ -1219,7 +1219,7 @@ sftp_server_usage(void) } int -sftp_server_main(int argc, char **argv) +sftp_server_main(int argc, char **argv, struct passwd *user_pw) { fd_set *rset, *wset; int in, out, max, ch, skipargs = 0, log_stderr = 0; @@ -1277,11 +1277,7 @@ sftp_server_main(int argc, char **argv) } else client_addr = xstrdup("UNKNOWN"); - if ((pw = getpwuid(getuid())) == NULL) { - error("No user found for uid %lu", (u_long)getuid()); - sftp_server_cleanup_exit(255); - } - pw = pwcopy(pw); + pw = pwcopy(user_pw); logit("session opened for local user %s from [%s]", pw->pw_name, client_addr); |