mirror of
https://github.com/samba-team/samba.git
synced 2024-12-28 07:21:54 +03:00
s3:smbd user_ok doesn't need sconn anymore
Signed-off-by: Andreas Schneider <asn@samba.org>
This commit is contained in:
parent
94bf9ce48a
commit
6a25668e55
@ -540,8 +540,7 @@ bool user_in_list(const char *user,const char **list)
|
|||||||
Check if a username is valid.
|
Check if a username is valid.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static bool user_ok(struct smbd_server_connection *sconn,
|
static bool user_ok(const char *user, int snum)
|
||||||
const char *user, int snum)
|
|
||||||
{
|
{
|
||||||
bool ret;
|
bool ret;
|
||||||
|
|
||||||
@ -611,7 +610,7 @@ static char *validate_group(struct smbd_server_connection *sconn,
|
|||||||
setnetgrent(group);
|
setnetgrent(group);
|
||||||
while (getnetgrent(&host, &user, &domain)) {
|
while (getnetgrent(&host, &user, &domain)) {
|
||||||
if (user) {
|
if (user) {
|
||||||
if (user_ok(sconn, user, snum) &&
|
if (user_ok(user, snum) &&
|
||||||
password_ok(actx, enc,
|
password_ok(actx, enc,
|
||||||
get_session_workgroup(sconn),
|
get_session_workgroup(sconn),
|
||||||
user,password)) {
|
user,password)) {
|
||||||
@ -677,7 +676,7 @@ static char *validate_group(struct smbd_server_connection *sconn,
|
|||||||
|
|
||||||
member = member_list;
|
member = member_list;
|
||||||
while (*member) {
|
while (*member) {
|
||||||
if (user_ok(sconn, member,snum) &&
|
if (user_ok(member,snum) &&
|
||||||
password_ok(actx, enc,
|
password_ok(actx, enc,
|
||||||
get_session_workgroup(sconn),
|
get_session_workgroup(sconn),
|
||||||
member,password)) {
|
member,password)) {
|
||||||
@ -756,7 +755,7 @@ bool authorise_login(struct smbd_server_connection *sconn,
|
|||||||
auser = strtok_r(NULL, LIST_SEP, &saveptr)) {
|
auser = strtok_r(NULL, LIST_SEP, &saveptr)) {
|
||||||
fstring user2;
|
fstring user2;
|
||||||
fstrcpy(user2,auser);
|
fstrcpy(user2,auser);
|
||||||
if (!user_ok(sconn,user2,snum))
|
if (!user_ok(user2,snum))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (password_ok(actx, enc,
|
if (password_ok(actx, enc,
|
||||||
@ -809,7 +808,7 @@ bool authorise_login(struct smbd_server_connection *sconn,
|
|||||||
} else {
|
} else {
|
||||||
fstring user2;
|
fstring user2;
|
||||||
fstrcpy(user2,auser);
|
fstrcpy(user2,auser);
|
||||||
if (user_ok(sconn,user2,snum) &&
|
if (user_ok(user2,snum) &&
|
||||||
password_ok(actx, enc,
|
password_ok(actx, enc,
|
||||||
get_session_workgroup(sconn),
|
get_session_workgroup(sconn),
|
||||||
user2,password)) {
|
user2,password)) {
|
||||||
@ -845,7 +844,7 @@ bool authorise_login(struct smbd_server_connection *sconn,
|
|||||||
*guest = True;
|
*guest = True;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ok && !user_ok(sconn, user, snum)) {
|
if (ok && !user_ok(user, snum)) {
|
||||||
DEBUG(0,("authorise_login: rejected invalid user %s\n",user));
|
DEBUG(0,("authorise_login: rejected invalid user %s\n",user));
|
||||||
ok = False;
|
ok = False;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user