summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/username.c31
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;
}