From 26fd73de7b25dfc191e5c164d3c375bae2b4c113 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Baumbach?= Date: Thu, 4 Jun 2020 13:51:30 +0200 Subject: [PATCH] tests/pysmbd: fill session unix info in ntacl tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Valid unix info is required. Bug: https://bugzilla.samba.org/show_bug.cgi?id=14400 Signed-off-by: Björn Baumbach Reviewed-by: Ralph Boehme --- python/samba/tests/posixacl.py | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/python/samba/tests/posixacl.py b/python/samba/tests/posixacl.py index 9f60b297c9b..4fcf7bb21ed 100644 --- a/python/samba/tests/posixacl.py +++ b/python/samba/tests/posixacl.py @@ -821,14 +821,24 @@ class SessionedPosixAclMappingTests(PosixAclMappingTests): """ if str(domsid) != str(self.samdb.get_domain_sid()): # fake it with admin session as domsid is not in local db - return auth.admin_session(self.lp, str(domsid)) + admin_session = auth.admin_session(self.lp, str(domsid)) + auth.session_info_fill_unix(admin_session, + lp_ctx=self.lp, + user_name="Administrator") + return admin_session dn = ''.format(domsid, security.DOMAIN_RID_ADMINISTRATOR) flags = (auth.AUTH_SESSION_INFO_DEFAULT_GROUPS | auth.AUTH_SESSION_INFO_AUTHENTICATED | auth.AUTH_SESSION_INFO_SIMPLE_PRIVILEGES) - return auth.user_session(self.samdb, lp_ctx=self.lp, dn=dn, - session_info_flags=flags) + user_session = auth.user_session(self.samdb, + lp_ctx=self.lp, + dn=dn, + session_info_flags=flags) + auth.session_info_fill_unix(user_session, + lp_ctx=self.lp, + user_name="Administrator") + return user_session class UnixSessionedPosixAclMappingTests(PosixAclMappingTests): @@ -842,7 +852,11 @@ class UnixSessionedPosixAclMappingTests(PosixAclMappingTests): """ if str(domsid) != str(self.samdb.get_domain_sid()): # fake it with admin session as domsid is not in local db - return auth.admin_session(self.lp, str(domsid)) + admin_session = auth.admin_session(self.lp, str(domsid)) + auth.session_info_fill_unix(admin_session, + lp_ctx=self.lp, + user_name="Administrator") + return admin_session dn = ''.format(domsid, security.DOMAIN_RID_ADMINISTRATOR) flags = (auth.AUTH_SESSION_INFO_DEFAULT_GROUPS |