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;
}