]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4-auth: allow to pass original_user_name=NULL to auth_session_info_fill_unix()
authorBjörn Baumbach <bb@sernet.de>
Tue, 25 Sep 2018 11:16:15 +0000 (13:16 +0200)
committerBjörn Baumbach <bb@sernet.de>
Thu, 11 Oct 2018 08:28:18 +0000 (10:28 +0200)
With this patch the auth_session_info_fill_unix() uses the "unix_name"
from the session_info->unix_info if no original_user_name was specified.

This is used to process a system session info where no original_user_name
is given.

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Volker Lendecke <vl@samba.org>
source4/auth/unix_token.c

index ef3805b6e40896b9f9600d038bcf1ce87b33506b..fdfbb24068215a0d87c2173007fe6ee3408fa763 100644 (file)
@@ -160,6 +160,10 @@ NTSTATUS auth_session_info_fill_unix(struct loadparm_context *lp_ctx,
                                                             session_info->info->account_name);
        NT_STATUS_HAVE_NO_MEMORY(session_info->unix_info->unix_name);
 
+       if (original_user_name == NULL) {
+               original_user_name = session_info->unix_info->unix_name;
+       }
+
        len = strlen(original_user_name) + 1;
        session_info->unix_info->sanitized_username = su = talloc_array(session_info->unix_info, char, len);
        NT_STATUS_HAVE_NO_MEMORY(su);