Hide home directory when chrooted or guest. From Ake Holmlund

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@25129 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2009-04-25 16:25:36 +00:00
parent cae7efb522
commit 22673e4df8
3 changed files with 7 additions and 4 deletions

View File

@@ -129,6 +129,7 @@ extern struct sockaddr *data_dest;
extern int logged_in; extern int logged_in;
extern struct passwd *pw; extern struct passwd *pw;
extern int guest; extern int guest;
extern int dochroot;
extern int logging; extern int logging;
extern int type; extern int type;
extern off_t file_size; extern off_t file_size;

View File

@@ -352,8 +352,12 @@ cmd
} }
| CWD CRLF check_login | CWD CRLF check_login
{ {
if ($3) if ($3) {
cwd(pw->pw_dir); const char *path = pw->pw_dir;
if (dochroot || guest)
path = "/";
cwd(path);
}
} }
| CWD SP pathname CRLF check_login | CWD SP pathname CRLF check_login
{ {

View File

@@ -73,8 +73,6 @@ RCSID("$Id$");
static int *pids; static int *pids;
static int fds; static int fds;
extern int dochroot;
/* return path prepended with ~ftp if that file exists, otherwise /* return path prepended with ~ftp if that file exists, otherwise
* return path unchanged * return path unchanged
*/ */