summaryrefslogtreecommitdiffstats
path: root/source/smbd/password.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2004-08-04 05:42:36 +0000
committerGerald Carter <jerry@samba.org>2004-08-04 05:42:36 +0000
commitfecd5ea163ffcd1bbee5b06e05112dbff9aa71b1 (patch)
tree917402d02525c39dd42d3aed01609ac02be104b4 /source/smbd/password.c
parent7cc5217c98cab4d0d970a2eb7f378319bedb6a46 (diff)
downloadsamba-fecd5ea163ffcd1bbee5b06e05112dbff9aa71b1.tar.gz
samba-fecd5ea163ffcd1bbee5b06e05112dbff9aa71b1.tar.xz
samba-fecd5ea163ffcd1bbee5b06e05112dbff9aa71b1.zip
r1643: syncing all changes from 3.0 and hopefully get 3.0.6rc2 out tomorrow
Diffstat (limited to 'source/smbd/password.c')
-rw-r--r--source/smbd/password.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/source/smbd/password.c b/source/smbd/password.c
index b2dbde151d0..3be1516cf04 100644
--- a/source/smbd/password.c
+++ b/source/smbd/password.c
@@ -253,19 +253,23 @@ int register_vuid(auth_serversupplied_info *server_info, DATA_BLOB session_key,
/* Register a home dir service for this user iff
(a) This is not a guest connection,
- (b) we have a home directory defined, and
- (c) there s not an existing static share by that name */
-
- if ( (!vuser->guest)
- && vuser->unix_homedir
- && *(vuser->unix_homedir)
- && (lp_servicenumber(vuser->user.unix_name) == -1) )
- {
- DEBUG(3, ("Adding/updating homes service for user '%s' using home directory: '%s'\n",
+ (b) we have a home directory defined
+ If a share exists by this name (autoloaded or not) reuse it so
+ long as the home directory is the same as the share directory. */
+
+ if ( (!vuser->guest) && vuser->unix_homedir && *(vuser->unix_homedir)) {
+ int servicenumber = lp_servicenumber(vuser->user.unix_name);
+ if ( servicenumber == -1 ) {
+ DEBUG(3, ("Adding homes service for user '%s' using home directory: '%s'\n",
vuser->user.unix_name, vuser->unix_homedir));
-
vuser->homes_snum = add_home_service(vuser->user.unix_name,
- vuser->user.unix_name, vuser->unix_homedir);
+ vuser->user.unix_name, vuser->unix_homedir);
+ } else if (strcmp(lp_pathname(servicenumber),vuser->unix_homedir) == 0) {
+ DEBUG(3, ("Reusing homes service for user '%s' using home directory: '%s'\n",
+ vuser->user.unix_name, vuser->unix_homedir));
+
+ vuser->homes_snum = servicenumber;
+ }
} else {
vuser->homes_snum = -1;
}