diff options
author | Björn Baumbach <bb@sernet.de> | 2020-06-04 13:51:30 +0200 |
---|---|---|
committer | Ralph Boehme <slow@samba.org> | 2020-06-05 10:32:31 +0000 |
commit | 26fd73de7b25dfc191e5c164d3c375bae2b4c113 (patch) | |
tree | c2a067f84490287d901e4193dea38d06947dc9e7 | |
parent | efea16f367e4b4e7bf140b15a023770470124898 (diff) | |
download | samba-26fd73de7b25dfc191e5c164d3c375bae2b4c113.tar.gz |
tests/pysmbd: fill session unix info in ntacl tests
Valid unix info is required.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=14400
Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Ralph Boehme <slow@samba.org>
-rw-r--r-- | python/samba/tests/posixacl.py | 22 |
1 files 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 = '<SID={0}-{1}>'.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 = '<SID={0}-{1}>'.format(domsid, security.DOMAIN_RID_ADMINISTRATOR) flags = (auth.AUTH_SESSION_INFO_DEFAULT_GROUPS | |