summaryrefslogtreecommitdiff
blob: e8d39b60b4d7ab5533175c7ffc30a82a26e616f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
Index: smbd/password.c
===================================================================
--- smbd/password.c	(revision 2069)
+++ smbd/password.c	(working copy)
@@ -252,27 +252,30 @@
 	}
 
 	/* 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 . */
 
-	if ( (!vuser->guest) && vuser->unix_homedir && *(vuser->unix_homedir)) {
+	vuser->homes_snum = -1;
+
+	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_pathname(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. */
Index: param/loadparm.c
===================================================================
--- param/loadparm.c	(revision 2069)
+++ param/loadparm.c	(working copy)
@@ -2305,6 +2305,10 @@
 	copy_service(ServicePtrs[i], &tservice, NULL);
 	if (name)
 		string_set(&ServicePtrs[i]->szService, name);
+		
+	DEBUG(8,("add_a_service: Creating snum = %d for %s\n", 
+		i, ServicePtrs[i]->szService));
+		
 	return (i);
 }
 
@@ -2344,7 +2348,7 @@
 	ServicePtrs[i]->autoloaded = True;
 
 	DEBUG(3, ("adding home's share [%s] for user '%s' at '%s'\n", pszHomename, 
-	       user, newHomedir));
+	       user, ServicePtrs[i]->szPath ));
 	
 	return (True);
 }