summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2004-08-26 20:47:58 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:52:30 -0500
commitdf5ee6a6ba2ebe445c8889625c2ee36eea81fcc8 (patch)
tree835a927d6ba0bc57419dcbef6f599bb738be0471 /source3/smbd
parentdb2ffe10f9283c86f95ae76d38c21916065a4b87 (diff)
downloadsamba-df5ee6a6ba2ebe445c8889625c2ee36eea81fcc8.tar.gz
samba-df5ee6a6ba2ebe445c8889625c2ee36eea81fcc8.tar.bz2
samba-df5ee6a6ba2ebe445c8889625c2ee36eea81fcc8.zip
r2077: fix logic bug in the check for creating a user's home directory in register_vuid(); add a few extra debug lines
(This used to be commit 02571e7f5040a577840c969ff9c46a1e533edc21)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/password.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/source3/smbd/password.c b/source3/smbd/password.c
index 3be1516cf0..decac845ac 100644
--- a/source3/smbd/password.c
+++ b/source3/smbd/password.c
@@ -252,27 +252,30 @@ 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
- 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. */
+ (c) there s not an existing static share by that name
+
+ If a share exists by this name (autoloaded or not) reuse it . */
+
+ vuser->homes_snum = -1;
- if ( (!vuser->guest) && vuser->unix_homedir && *(vuser->unix_homedir)) {
+ 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);
- } 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));
-
+ } else {
+ DEBUG(3, ("Using static (or previously created) service for user '%s'; path = '%s'\n",
+ vuser->user.unix_name, lp_path(servicenumber) ));
vuser->homes_snum = servicenumber;
}
- } else {
- vuser->homes_snum = -1;
- }
+ }
if (srv_is_signing_negotiated() && !vuser->guest && !srv_signing_started()) {
/* Try and turn on server signing on the first non-guest sessionsetup. */