mirror of
https://github.com/borgbackup/borg.git
synced 2025-02-25 15:33:39 +00:00
fix test_recreate_basic on cygwin
looks like that chmod should only get done IF we are root (and on linux?). taking away write permissions on windows/cygwin (and when running as normal user) makes create_regular_file fail when it tries to create dir2/file3.
This commit is contained in:
parent
f088682bc9
commit
15c51ee3c6
1 changed files with 2 additions and 2 deletions
|
@ -235,10 +235,10 @@ def create_test_files(self, create_hardlinks=True):
|
|||
os.mknod("input/bdev", 0o600 | stat.S_IFBLK, os.makedev(10, 20))
|
||||
# Char device
|
||||
os.mknod("input/cdev", 0o600 | stat.S_IFCHR, os.makedev(30, 40))
|
||||
# File mode
|
||||
os.chmod("input/dir2", 0o555) # if we take away write perms, we need root to remove contents
|
||||
# File owner
|
||||
os.chown("input/file1", 100, 200) # raises OSError invalid argument on cygwin
|
||||
# File mode
|
||||
os.chmod("input/dir2", 0o555) # if we take away write perms, we need root to remove contents
|
||||
have_root = True # we have (fake)root
|
||||
except PermissionError:
|
||||
have_root = False
|
||||
|
|
Loading…
Reference in a new issue