diff options
author | Tim Potter <tpot@samba.org> | 2001-12-18 06:11:32 +0000 |
---|---|---|
committer | Tim Potter <tpot@samba.org> | 2001-12-18 06:11:32 +0000 |
commit | f0e8a3d5e8bef267c032c0e6a4df666547334cb3 (patch) | |
tree | 6672281c4b6dec52ce5edb01aaaa031507773606 /source3/lib | |
parent | 7cb202e33cf3dd301729cea5adff3b7b1ca58ce3 (diff) | |
download | samba-f0e8a3d5e8bef267c032c0e6a4df666547334cb3.tar.gz samba-f0e8a3d5e8bef267c032c0e6a4df666547334cb3.tar.bz2 samba-f0e8a3d5e8bef267c032c0e6a4df666547334cb3.zip |
A fix to override the location of a user's home directory if it is
specified in the [homes] section of the smb.conf file.
Jeremy, can you take a look at this? This is in response to someone on the
samba mailing list worrying about it.
Tim.
From: Phil Thompson <philnanne@mediaone.net>
To: samba@lists.samba.org
Subject: Different [homes] behavior in 2.2.2
X-Original-Date: Mon, 17 Dec 2001 23:09:28 -0500
Is it possible to configure samba to disregard the home directory in the
passwd file when using [homes]? Even though an alternate "path" is set
in [homes], the service fails since the unix home directory is invalid
(nonexistent) on the server.
[...]
This behavior of validating the user's home dir as set in the passwd
files appears to be new
in 2.2.2 and the latest CVS. Anyway to work around this?
(This used to be commit c15dec74a360c6b20f536708e00e61d1d27dcbfc)
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/username.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/source3/lib/username.c b/source3/lib/username.c index e65f133812..17627d4dae 100644 --- a/source3/lib/username.c +++ b/source3/lib/username.c @@ -43,6 +43,22 @@ BOOL name_is_local(const char *name) char *get_user_home_dir(const char *user) { static struct passwd *pass; + int snum; + + /* If a path is specified in [homes] then use it instead of the + user's home directory from struct passwd. */ + + if ((snum = lp_servicenumber(HOMES_NAME)) != -1) { + static pstring home_dir; + + pstrcpy(home_dir, lp_pathname(snum)); + standard_sub_snum(snum, home_dir); + + if (home_dir[0]) + return home_dir; + } + + /* Get home directory from struct passwd. */ pass = Get_Pwnam(user); |