From: Björn Jacke Date: Tue, 15 Oct 2024 09:43:58 +0000 (+0200) Subject: samba-tool/backup: set the right permissions on our root dir X-Git-Tag: tdb-1.4.13~370 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b9755f88404c5c4ed7f68173daf398afac932191;p=thirdparty%2Fsamba.git samba-tool/backup: set the right permissions on our root dir Since processes can run under the UID of the logged in user, it's required to make sure that the users have the permissions here. Signed-off-by: Bjoern Jacke Reviewed-by: Björn Baumbach Autobuild-User(master): Björn Baumbach Autobuild-Date(master): Tue Dec 10 11:40:27 UTC 2024 on atb-devel-224 --- diff --git a/python/samba/netcmd/domain/backup.py b/python/samba/netcmd/domain/backup.py index b1b57c04a7f..a72c6daaded 100644 --- a/python/samba/netcmd/domain/backup.py +++ b/python/samba/netcmd/domain/backup.py @@ -500,6 +500,8 @@ class cmd_domain_backup_restore(cmd_fsmo_seize): tf = tarfile.open(backup_file) tf.extractall(targetdir) tf.close() + # set the permissions on the target dir strict but also relaxed enough + os.chmod(targetdir, mode=0o755) # use the smb.conf that got backed up, by default (save what was # actually backed up, before we mess with it)