1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00

r21387: Another important fix for non-AD domains:

Avoid assigning 0 as primary group id for users in NSS calls.
Jerry, please check.

Guenther
This commit is contained in:
Günther Deschner 2007-02-16 15:13:57 +00:00 committed by Gerald (Jerry) Carter
parent b84370513f
commit 03f5f7d014
2 changed files with 3 additions and 7 deletions

View File

@ -416,6 +416,7 @@ static NTSTATUS query_user(struct winbindd_domain *domain,
user_info->homedir = NULL;
user_info->shell = NULL;
user_info->primary_gid = (gid_t)-1;
SAFE_FREE(user);
@ -454,6 +455,7 @@ static NTSTATUS query_user(struct winbindd_domain *domain,
&ctr->info.id21->uni_full_name);
user_info->homedir = NULL;
user_info->shell = NULL;
user_info->primary_gid = (gid_t)-1;
return NT_STATUS_OK;
}

View File

@ -286,6 +286,7 @@ static void getpwsid_sid2gid_recv(void *private_data, BOOL success, gid_t gid)
call worked or not. --jerry */
if ( s->gid == (gid_t)-1 ) {
if (!success) {
DEBUG(5, ("Could not query user's %s\\%s\n gid",
s->domain->name, s->username));
@ -296,13 +297,6 @@ static void getpwsid_sid2gid_recv(void *private_data, BOOL success, gid_t gid)
s->gid = gid;
}
/* allow the nss backend to override the primary group ID.
If the gid has already been set, then keep it */
if ( s->gid == (gid_t)-1 ) {
s->gid = gid;
}
pw = &s->state->response.data.pw;
pw->pw_uid = s->uid;
pw->pw_gid = s->gid;