mirror of
https://github.com/samba-team/samba.git
synced 2025-03-10 12:58:35 +03:00
s3: don't make same innetgr check twice
This commit is contained in:
parent
9d7cb4826a
commit
d9c0d58236
@ -428,16 +428,16 @@ bool user_in_netgroup(struct smbd_server_connection *sconn,
|
|||||||
if (innetgr(ngname, NULL, user, sconn->smb1.sessions.my_yp_domain)) {
|
if (innetgr(ngname, NULL, user, sconn->smb1.sessions.my_yp_domain)) {
|
||||||
DEBUG(5,("user_in_netgroup: Found\n"));
|
DEBUG(5,("user_in_netgroup: Found\n"));
|
||||||
return true;
|
return true;
|
||||||
} else {
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Ok, innetgr is case sensitive. Try once more with lowercase
|
* Ok, innetgr is case sensitive. Try once more with lowercase
|
||||||
* just in case. Attempt to fix #703. JRA.
|
* just in case. Attempt to fix #703. JRA.
|
||||||
*/
|
*/
|
||||||
|
fstrcpy(lowercase_user, user);
|
||||||
fstrcpy(lowercase_user, user);
|
strlower_m(lowercase_user);
|
||||||
strlower_m(lowercase_user);
|
|
||||||
|
|
||||||
|
if (strcmp(user,lowercase_user) != 0) {
|
||||||
DEBUG(5,("looking for user %s of domain %s in netgroup %s\n",
|
DEBUG(5,("looking for user %s of domain %s in netgroup %s\n",
|
||||||
lowercase_user,
|
lowercase_user,
|
||||||
sconn->smb1.sessions.my_yp_domain?
|
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"));
|
DEBUG(5,("user_in_netgroup: Found\n"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
/* user name was already lower case! */
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
#endif /* HAVE_NETGROUP */
|
#endif /* HAVE_NETGROUP */
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user