diff options
author | Günther Deschner <gd@samba.org> | 2007-02-16 15:13:57 +0000 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2007-02-16 15:13:57 +0000 |
commit | 528e108cf85d34be794dc3fd4d8c43ec46205165 (patch) | |
tree | 569987d876e2d4a85f776ed47d514a2edc2f8dc8 | |
parent | 61007a182d4ef5069aebc64899488dbd7fb2c6a4 (diff) | |
download | samba-528e108cf85d34be794dc3fd4d8c43ec46205165.tar.gz samba-528e108cf85d34be794dc3fd4d8c43ec46205165.tar.xz samba-528e108cf85d34be794dc3fd4d8c43ec46205165.zip |
r21387: Another important fix for non-AD domains:
Avoid assigning 0 as primary group id for users in NSS calls.
Jerry, please check.
Guenther
-rw-r--r-- | source/nsswitch/winbindd_rpc.c | 2 | ||||
-rw-r--r-- | source/nsswitch/winbindd_user.c | 8 |
2 files changed, 3 insertions, 7 deletions
diff --git a/source/nsswitch/winbindd_rpc.c b/source/nsswitch/winbindd_rpc.c index c3d70660987..11d9fe0dbbd 100644 --- a/source/nsswitch/winbindd_rpc.c +++ b/source/nsswitch/winbindd_rpc.c @@ -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; } diff --git a/source/nsswitch/winbindd_user.c b/source/nsswitch/winbindd_user.c index aa9ece7d893..9df3a6a3bc1 100644 --- a/source/nsswitch/winbindd_user.c +++ b/source/nsswitch/winbindd_user.c @@ -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; |