mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-04 03:49:02 +00:00
Set "HOME" so that tilde expands correctly. It previously was always root's
directory /root.
This commit is contained in:
parent
0d8da7331a
commit
82c76939c1
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=8696
@ -552,6 +552,7 @@ pass(passwd)
|
||||
{
|
||||
char *salt, *xpasswd;
|
||||
FILE *fd;
|
||||
static char homedir[MAXPATHLEN];
|
||||
|
||||
if (logged_in || askpasswd == 0) {
|
||||
reply(503, "Login with USER first.");
|
||||
@ -627,6 +628,12 @@ pass(passwd)
|
||||
reply(550, "Can't set uid.");
|
||||
goto bad;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set home directory so that use of ~ (tilde) works correctly.
|
||||
*/
|
||||
setenv("HOME", getcwd(homedir, MAXPATHLEN), 1);
|
||||
|
||||
/*
|
||||
* Display a login message, if it exists.
|
||||
* N.B. reply(230,) must follow the message.
|
||||
|
Loading…
Reference in New Issue
Block a user