s3: spoolss: Make parameters in call to user_ok_token() match all other uses.
authorJeremy Allison <jra@samba.org>
Thu, 5 Nov 2020 23:48:08 +0000 (15:48 -0800)
committerKarolin Seeger <kseeger@samba.org>
Thu, 19 Nov 2020 12:39:01 +0000 (12:39 +0000)
We already have p->session_info->unix_info->unix_name, we don't
need to go through a legacy call to uidtoname(p->session_info->unix_token->uid).

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14568

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Nov  9 04:10:45 UTC 2020 on sn-devel-184

(cherry picked from commit e5e1759057a767f517bf480a2172a36623df2799)

source3/rpc_server/spoolss/srv_spoolss_nt.c

index c80fc2aac2d058548c45a77671a2b2c8e392e14b..eb47cb20581744b0a5e77aaf627aac9099d34b58 100644 (file)
@@ -1871,7 +1871,8 @@ WERROR _spoolss_OpenPrinterEx(struct pipes_struct *p,
                        return WERR_ACCESS_DENIED;
                }
 
-               if (!user_ok_token(uidtoname(p->session_info->unix_token->uid), NULL,
+               if (!user_ok_token(p->session_info->unix_info->unix_name,
+                                  p->session_info->info->domain_name,
                                   p->session_info->security_token, snum) ||
                    !W_ERROR_IS_OK(print_access_check(p->session_info,
                                                      p->msg_ctx,