Fixed issue with null ypdomainname being used.
authorSamba Release Account <samba-bugs@samba.org>
Wed, 29 Jan 1997 22:28:10 +0000 (22:28 +0000)
committerSamba Release Account <samba-bugs@samba.org>
Wed, 29 Jan 1997 22:28:10 +0000 (22:28 +0000)
Jermy.

source/lib/username.c

index 0b82d79747b82fc95477d97937e570e983d8d105..07987fafb30b92e05b6dec25ce88fadb17f6b666 100644 (file)
@@ -198,15 +198,23 @@ BOOL user_in_list(char *user,char *list)
          static char *mydomain = NULL;
          if (mydomain == 0)
            yp_get_default_domain(&mydomain);
+
+         if(mydomain == 0)
+           {
+              DEBUG(5,("Unable to get default yp domain\n"));
+            }
+          else
+           {
          
-         DEBUG(5,("looking for user %s of domain %s in netgroup %s\n",
+             DEBUG(5,("looking for user %s of domain %s in netgroup %s\n",
                   user, mydomain, &tok[1]));
-         DEBUG(5,("innetgr is %s\n",
+             DEBUG(5,("innetgr is %s\n",
                   innetgr(&tok[1], (char *) 0, user, mydomain)
                   ? "TRUE" : "FALSE"));
          
-         if (innetgr(&tok[1], (char *)0, user, mydomain))
-           return (True);
+             if (innetgr(&tok[1], (char *)0, user, mydomain))
+               return (True);
+            }
        }
 #endif