diff options
author | Björn Jacke <bj@sernet.de> | 2009-07-14 17:40:21 +0200 |
---|---|---|
committer | Björn Jacke <bj@sernet.de> | 2009-07-14 17:42:05 +0200 |
commit | d9c0d5823624d302c6fa635d2e44aab985fd307c (patch) | |
tree | f8e0d3ead6ce426f465bd2bbf7c95ed8b2016dae /source3/smbd | |
parent | 9d7cb4826a7b605a170bd5d5efee331557188b6e (diff) | |
download | samba-d9c0d5823624d302c6fa635d2e44aab985fd307c.tar.gz samba-d9c0d5823624d302c6fa635d2e44aab985fd307c.tar.bz2 samba-d9c0d5823624d302c6fa635d2e44aab985fd307c.zip |
s3: don't make same innetgr check twice
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/password.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/source3/smbd/password.c b/source3/smbd/password.c index 928ef0169e..58824b6e23 100644 --- a/source3/smbd/password.c +++ b/source3/smbd/password.c @@ -428,16 +428,16 @@ bool user_in_netgroup(struct smbd_server_connection *sconn, if (innetgr(ngname, NULL, user, sconn->smb1.sessions.my_yp_domain)) { DEBUG(5,("user_in_netgroup: Found\n")); return true; - } else { - - /* - * 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); + /* + * 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); + if (strcmp(user,lowercase_user) != 0) { DEBUG(5,("looking for user %s of domain %s in netgroup %s\n", lowercase_user, sconn->smb1.sessions.my_yp_domain? @@ -449,6 +449,9 @@ bool user_in_netgroup(struct smbd_server_connection *sconn, DEBUG(5,("user_in_netgroup: Found\n")); return true; } + } else { + /* user name was already lower case! */ + return false; } #endif /* HAVE_NETGROUP */ return false; |