1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00

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 commit is contained in:
Tim Potter 0001-01-01 00:00:00 +00:00
parent 5095941dcb
commit c15dec74a3

View File

@ -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);