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:
@@ -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;
|
||||||
|
@@ -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
|
||||||
{
|
{
|
||||||
|
@@ -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
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user