bug 977 - don't create a homes share for a user if a static share already exists...
authorGerald Carter <jerry@samba.org>
Tue, 27 Jan 2004 15:28:33 +0000 (15:28 +0000)
committerGerald Carter <jerry@samba.org>
Tue, 27 Jan 2004 15:28:33 +0000 (15:28 +0000)
(This used to be commit 6b89a76aa7efaa0ad7a0139aeb3e4ebf5c01cdcb)

source3/smbd/password.c

index 494d9ecd4396582705a6076e73131f6912dcca5f..36e3fb473828d57af6e351ceb55f7646e05f2e93 100644 (file)
@@ -254,7 +254,13 @@ int register_vuid(auth_serversupplied_info *server_info, DATA_BLOB session_key,
        if ((!vuser->guest) && vuser->unix_homedir && *(vuser->unix_homedir)) {
                DEBUG(3, ("Adding/updating 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);          
+
+               /* only add the home directory if there doesn't exist a static share by that name */
+               if ( lp_servicenumber(vuser->user.unix_name) == -1 ) {
+                       vuser->homes_snum = add_home_service(vuser->user.unix_name, 
+                               vuser->user.unix_name, vuser->unix_homedir);
+               }
+
        } else {
                vuser->homes_snum = -1;
        }