r17408: Let us use netgroups even without a NIS domain but just using files
authorSimo Sorce <idra@samba.org>
Fri, 4 Aug 2006 22:18:02 +0000 (22:18 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:38:32 +0000 (11:38 -0500)
(This used to be commit c065341d3ffc9125514f563c63d416cf7c40375f)

source3/lib/access.c
source3/smbd/password.c

index fcc795d1f266c15f80f3160990b4595a00a1f9e9..303e3ed4c491adb18a39e0a4aea775ea3183b5af 100644 (file)
@@ -83,8 +83,7 @@ static BOOL string_match(const char *tok,const char *s, char *invalid_char)
                        yp_get_default_domain(&mydomain);
 
                if (!mydomain) {
-                       DEBUG(0,("Unable to get default yp domain.\n"));
-                       return False;
+                       DEBUG(0,("Unable to get default yp domain. Try without it.\n"));
                }
                if (!(hostname = SMB_STRDUP(s))) {
                        DEBUG(1,("out of memory for strdup!\n"));
@@ -95,7 +94,7 @@ static BOOL string_match(const char *tok,const char *s, char *invalid_char)
                
                DEBUG(5,("looking for %s of domain %s in netgroup %s gave %s\n", 
                         hostname,
-                        mydomain, 
+                        mydomain?mydomain:"(ANY)"
                         tok+1,
                         BOOLSTR(netgroup_ok)));
 
index 389086e9bf7a840b1bc87fa884a0edb449abf266..38000e93f4b8ebaaff6395d9a8cf04fe90e9289f 100644 (file)
@@ -417,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"));
@@ -438,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"));