add a test for unreadable parent dir, see #7746

This commit is contained in:
Thomas Waldmann 2023-07-29 22:45:56 +02:00
parent a3f4adf899
commit 453d35fa47
No known key found for this signature in database
GPG Key ID: 243ACFA951F78E01
1 changed files with 10 additions and 0 deletions

View File

@ -487,6 +487,16 @@ class ArchiverTestCase(ArchiverTestCaseBase):
self.cmd('init', '--encryption=none', '--make-parent-dirs', repository_location)
assert os.path.exists(parent_path)
def test_create_unreadable_parent(self):
parent_dir = os.path.join(self.input_path, 'parent')
root_dir = os.path.join(self.input_path, 'parent', 'root')
os.mkdir(parent_dir)
os.mkdir(root_dir)
os.chmod(parent_dir, 0o111) # --x--x--x == parent dir traversable, but not readable
self.cmd('init', '--encryption=none', self.repository_location)
# issue #7746: we *can* read root_dir and we *can* traverse parent_dir, so this should work:
self.cmd('create', self.repository_location + '::test', root_dir)
def test_unix_socket(self):
self.cmd('init', '--encryption=repokey', self.repository_location)
try: