r21108: Send sys_notify_watch through the VFS, FAM is next
[ira/wip.git] / source3 / smbd / password.c
index 73b0ebb4b32f1b3e300bf69ac3287fbefa78d338..38000e93f4b8ebaaff6395d9a8cf04fe90e9289f 100644 (file)
@@ -29,9 +29,6 @@ static user_struct *validated_users;
 static int next_vuid = VUID_OFFSET;
 static int num_validated_vuids;
 
-extern userdom_struct current_user_info;
-
-
 /****************************************************************************
  Check if a uid has been validated, and return an pointer to the user_struct
  if it has. NULL if not. vuid is biased by an offset. This allows us to
@@ -420,12 +417,11 @@ BOOL user_in_netgroup(const char *user, const char *ngname)
                yp_get_default_domain(&mydomain);
 
        if(mydomain == NULL) {
-               DEBUG(5,("Unable to get default yp domain\n"));
-               return False;
+               DEBUG(5,("Unable to get default yp domain, let's try without specifying it\n"));
        }
 
        DEBUG(5,("looking for user %s of domain %s in netgroup %s\n",
-               user, mydomain, ngname));
+               user, mydomain?mydomain:"(ANY)", ngname));
 
        if (innetgr(ngname, NULL, user, mydomain)) {
                DEBUG(5,("user_in_netgroup: Found\n"));
@@ -441,7 +437,7 @@ BOOL user_in_netgroup(const char *user, const char *ngname)
                strlower_m(lowercase_user);
        
                DEBUG(5,("looking for user %s of domain %s in netgroup %s\n",
-                       lowercase_user, mydomain, ngname));
+                       lowercase_user, mydomain?mydomain:"(ANY)", ngname));
 
                if (innetgr(ngname, NULL, lowercase_user, mydomain)) {
                        DEBUG(5,("user_in_netgroup: Found\n"));
@@ -550,9 +546,11 @@ static BOOL user_ok(const char *user, int snum)
                str_list_copy(&invalid, lp_invalid_users(snum));
                if (invalid &&
                    str_list_substitute(invalid, "%S", lp_servicename(snum))) {
-                       if ( invalid &&
-                            str_list_sub_basic(invalid,
-                                               current_user_info.smb_name) ) {
+
+                       /* This is used in sec=share only, so no current user
+                        * around to pass to str_list_sub_basic() */
+
+                       if ( invalid && str_list_sub_basic(invalid, "", "") ) {
                                ret = !user_in_list(user,
                                                    (const char **)invalid);
                        }
@@ -565,9 +563,11 @@ static BOOL user_ok(const char *user, int snum)
                str_list_copy(&valid, lp_valid_users(snum));
                if ( valid &&
                     str_list_substitute(valid, "%S", lp_servicename(snum)) ) {
-                       if ( valid &&
-                            str_list_sub_basic(valid,
-                                               current_user_info.smb_name) ) {
+
+                       /* This is used in sec=share only, so no current user
+                        * around to pass to str_list_sub_basic() */
+
+                       if ( valid && str_list_sub_basic(valid, "", "") ) {
                                ret = user_in_list(user, (const char **)valid);
                        }
                }