diff options
author | Gerald Carter <jerry@samba.org> | 2004-06-03 20:32:13 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:51:53 -0500 |
commit | a020879964f76c7b00235715883ec897ff83adc0 (patch) | |
tree | 555ea45395df2081f0580032eb8fa70d12838f87 /source3/lib | |
parent | 9dbf2e2419e2ba0f2293b4a7a5971123f34a09ad (diff) | |
download | samba-a020879964f76c7b00235715883ec897ff83adc0.tar.gz samba-a020879964f76c7b00235715883ec897ff83adc0.tar.bz2 samba-a020879964f76c7b00235715883ec897ff83adc0.zip |
r993: BUG 703 -- finishing patch by Eric Boehm <boehm@nortelnetworks.com> for netgroup case lookups
(This used to be commit 82f3fee5954ef57e922a9da077893422e054839f)
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/username.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/source3/lib/username.c b/source3/lib/username.c index ac5530b5c7..317935d396 100644 --- a/source3/lib/username.c +++ b/source3/lib/username.c @@ -306,7 +306,7 @@ static BOOL user_in_netgroup_list(const char *user, const char *ngname) { #ifdef HAVE_NETGROUP static char *mydomain = NULL; - fstring lowercase_user, lowercase_ngname; + fstring lowercase_user; if (mydomain == NULL) yp_get_default_domain(&mydomain); @@ -318,25 +318,28 @@ static BOOL user_in_netgroup_list(const char *user, const char *ngname) DEBUG(5,("looking for user %s of domain %s in netgroup %s\n", user, mydomain, ngname)); - DEBUG(5,("innetgr is %s\n", innetgr(ngname, NULL, user, mydomain) - ? "TRUE" : "FALSE")); - if (innetgr(ngname, NULL, user, mydomain)) + if (innetgr(ngname, NULL, user, mydomain)) { + DEBUG(5,("user_in_netgroup_list: Found\n")); return (True); + } else { - /* - * Ok, innetgr is case sensitive. Try once more with lowercase - * just in case. Attempt to fix #703. JRA. - */ + /* + * Ok, innetgr is case sensitive. Try once more with lowercase + * just in case. Attempt to fix #703. JRA. + */ - fstrcpy(lowercase_user, user); - strlower_m(lowercase_user); - fstrcpy(lowercase_ngname, ngname); - strlower_m(lowercase_ngname); + fstrcpy(lowercase_user, user); + strlower_m(lowercase_user); - if (innetgr(lowercase_ngname, NULL, lowercase_user, mydomain)) - return (True); + DEBUG(5,("looking for user %s of domain %s in netgroup %s\n", + lowercase_user, mydomain, ngname)); + if (innetgr(ngname, NULL, lowercase_user, mydomain)) { + DEBUG(5,("user_in_netgroup_list: Found\n")); + return (True); + } + } #endif /* HAVE_NETGROUP */ return False; } |