From a020879964f76c7b00235715883ec897ff83adc0 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Thu, 3 Jun 2004 20:32:13 +0000 Subject: r993: BUG 703 -- finishing patch by Eric Boehm for netgroup case lookups (This used to be commit 82f3fee5954ef57e922a9da077893422e054839f) --- source3/lib/username.c | 31 +++++++++++++++++-------------- 1 file 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; } -- cgit