]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: call set_current_user_info() in smbd_become_authenticated_pipe_user()
authorRalph Boehme <slow@samba.org>
Thu, 11 Mar 2021 10:20:52 +0000 (11:20 +0100)
committerJeremy Allison <jra@samba.org>
Fri, 12 Mar 2021 00:54:01 +0000 (00:54 +0000)
The current_user_info is updated at the SMB level, but currently not at the RPC
level in the RPC impersonation function smbd_become_authenticated_pipe_user().

For RPC services running embedded this is not an issue as the SMB level
impersonation has already taken care of current_user_info, but for RPC services
running as external daemons, eg spoolssd, the omission of updating
current_user_info results in variable expansion of eg %U (username) to be
broken.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14668
MR: https://gitlab.com/samba-team/samba/-/merge_requests/1834
RN: %U variable expansion not working in spoolsd

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Mar 12 00:54:01 UTC 2021 on sn-devel-184

selftest/knownfail.d/samba3.blackbox.printing_var_exp [deleted file]
source3/smbd/uid.c

diff --git a/selftest/knownfail.d/samba3.blackbox.printing_var_exp b/selftest/knownfail.d/samba3.blackbox.printing_var_exp
deleted file mode 100644 (file)
index 5312a58..0000000
+++ /dev/null
@@ -1 +0,0 @@
-^samba3.blackbox.printing_var_exp.Test variable expansion.*
index 11e5efb6cf1bc0aa5f666b38916718cc989623c6..b0d7f21c200f43fe4ecdce72b190d8fa6d0e8a4b 100644 (file)
@@ -510,6 +510,10 @@ bool smbd_become_authenticated_pipe_user(struct auth_session_info *session_info)
        if (!push_sec_ctx())
                return False;
 
+       set_current_user_info(session_info->unix_info->sanitized_username,
+                             session_info->unix_info->unix_name,
+                             session_info->info->domain_name);
+
        set_sec_ctx(session_info->unix_token->uid, session_info->unix_token->gid,
                    session_info->unix_token->ngroups, session_info->unix_token->groups,
                    session_info->security_token);