1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-16 00:23:52 +03:00

s3: Test that store_smb2_posix_info hides info for '..'

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
This commit is contained in:
David Mulder
2022-11-03 10:28:58 -06:00
committed by Volker Lendecke
parent d0ad452fc8
commit bbc82a5d42
2 changed files with 25 additions and 5 deletions

View File

@@ -185,7 +185,7 @@ class Smb3UnixTests(samba.tests.libsmb.LibsmbTests):
actual_count = len(c.list('',
info_level=libsmb.SMB2_FIND_POSIX_INFORMATION,
posix=True))
self.assertEqual(actual_count, expected_count,
self.assertEqual(actual_count-2, expected_count,
'SMB2_FIND_POSIX_INFORMATION failed to list contents')
finally:
@@ -336,3 +336,27 @@ class Smb3UnixTests(samba.tests.libsmb.LibsmbTests):
self.delete_test_file(c, '\\%s' % fname)
self.disable_smb3unix()
def test_share_root_null_sids_fid(self):
try:
self.enable_smb3unix()
c = libsmb.Conn(
self.server_ip,
"smb3_posix_share",
self.lp,
self.creds,
posix=True)
self.assertTrue(c.have_posix())
res = c.list("", info_level=100, posix=True)
found_files = {get_string(i['name']): i for i in res}
dotdot = found_files['..']
self.assertEqual('S-1-0-0', dotdot['owner_sid'],
'The owner sid for .. was not NULL')
self.assertEqual('S-1-0-0', dotdot['group_sid'],
'The group sid for .. was not NULL')
self.assertEqual(0, dotdot['ino'], 'The ino for .. was not 0')
self.assertEqual(0, dotdot['dev'], 'The dev for .. was not 0')
finally:
self.disable_smb3unix()