summaryrefslogtreecommitdiffstats
path: root/source/lib
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2004-06-03 20:32:13 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:51:53 -0500
commit82f3fee5954ef57e922a9da077893422e054839f (patch)
tree93d59142c6a39890a1db3e997698db03783298e7 /source/lib
parente9f109d1b38e0b0adec9b7e9a907f90a79d297ea (diff)
downloadsamba-82f3fee5954ef57e922a9da077893422e054839f.tar.gz
samba-82f3fee5954ef57e922a9da077893422e054839f.tar.xz
samba-82f3fee5954ef57e922a9da077893422e054839f.zip
r993: BUG 703 -- finishing patch by Eric Boehm <boehm@nortelnetworks.com> for netgroup case lookups
Diffstat (limited to 'source/lib')
-rw-r--r--source/lib/username.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/source/lib/username.c b/source/lib/username.c
index ac5530b5c71..317935d396f 100644
--- a/source/lib/username.c
+++ b/source/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;
}