]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: setting current_user stuff here is redundant
authorRalph Boehme <slow@samba.org>
Fri, 17 Jan 2020 13:42:22 +0000 (14:42 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Thu, 6 Feb 2020 10:17:42 +0000 (10:17 +0000)
This is already handled by set_sec_ctx() below, we just have to pass in the
values instead of setting it here in this function before calling set_sec_ctx().

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/smbd/uid.c

index 9b983df80db5151039d69bb53a7b0e9ae5603d35..f425f209bb95d77d03246df1f3c24de6ca6ee00b 100644 (file)
@@ -413,14 +413,10 @@ static bool change_to_user_impersonate(connection_struct *conn,
                }
        }
 
-       /*Set current_user since we will immediately also call set_sec_ctx() */
-       current_user.ut.ngroups = num_groups;
-       current_user.ut.groups  = group_list;
-
        set_sec_ctx(uid,
                    gid,
-                   current_user.ut.ngroups,
-                   current_user.ut.groups,
+                   num_groups,
+                   group_list,
                    conn->session_info->security_token);
 
        current_user.conn = conn;