diff options
author | Jeremy Allison <jra@samba.org> | 2002-01-16 23:32:10 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2002-01-16 23:32:10 +0000 |
commit | 5cf6457bcc1182eac99f5618b647153707fa41ab (patch) | |
tree | d42b47d76c18fc6e3cd2ed8e313cf8ff01d06314 /source3/lib/username.c | |
parent | 04ec469c72c6a220108312cdec3d30081cfe938a (diff) | |
download | samba-5cf6457bcc1182eac99f5618b647153707fa41ab.tar.gz samba-5cf6457bcc1182eac99f5618b647153707fa41ab.tar.bz2 samba-5cf6457bcc1182eac99f5618b647153707fa41ab.zip |
Merged in %S fixes and XX_NOT_CHANGED fixes from 2.2.
Jeremy.
(This used to be commit 0fcca6c627a5c9c2219ec9714df5e0bc1a44cc29)
Diffstat (limited to 'source3/lib/username.c')
-rw-r--r-- | source3/lib/username.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/source3/lib/username.c b/source3/lib/username.c index 8154a2b40e..c7e25b7cd1 100644 --- a/source3/lib/username.c +++ b/source3/lib/username.c @@ -45,6 +45,13 @@ char *get_user_home_dir(const char *user) static struct passwd *pass; int snum; + /* Ensure the user exists. */ + + pass = Get_Pwnam(user); + + if (!pass) + return(NULL); + /* If a path is specified in [homes] then use it instead of the user's home directory from struct passwd. */ @@ -52,18 +59,14 @@ char *get_user_home_dir(const char *user) static pstring home_dir; pstrcpy(home_dir, lp_pathname(snum)); - standard_sub_snum(snum, home_dir); + standard_sub_home(snum, user, home_dir); if (home_dir[0]) return home_dir; } - /* Get home directory from struct passwd. */ - - pass = Get_Pwnam(user); + /* Return home directory from struct passwd. */ - if (!pass) - return(NULL); return(pass->pw_dir); } |