r21387: Another important fix for non-AD domains:
authorGünther Deschner <gd@samba.org>
Fri, 16 Feb 2007 15:13:57 +0000 (15:13 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:18:01 +0000 (12:18 -0500)
Avoid assigning 0 as primary group id for users in NSS calls.
Jerry, please check.

Guenther

source/nsswitch/winbindd_rpc.c
source/nsswitch/winbindd_user.c

index c3d706609877510a59eac14143b286a083d37c8c..11d9fe0dbbd91e8145e1529bc8f33d893dfa446b 100644 (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;
 }                                   
index aa9ece7d89336ed989f2eef6c6bf8559c4886010..9df3a6a3bc1882560b7c69bf75ca30022a3a704f 100644 (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;