From: Douglas Bagnall Date: Wed, 26 Mar 2025 02:55:33 +0000 (+1300) Subject: samba-tool backup restore: cope with no sysvol X-Git-Tag: tevent-0.17.0~440 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a65a9e2e34cf02cd10ec9028782f7a43dc6cfebb;p=thirdparty%2Fsamba.git samba-tool backup restore: cope with no sysvol BUG: https://bugzilla.samba.org/show_bug.cgi?id=15661 Signed-off-by: Douglas Bagnall Reviewed-by: Ralph Boehme Autobuild-User(master): Ralph Böhme Autobuild-Date(master): Sat Mar 29 08:25:39 UTC 2025 on atb-devel-224 --- diff --git a/python/samba/netcmd/domain/backup.py b/python/samba/netcmd/domain/backup.py index 1769909fb93..5ad9987eec6 100644 --- a/python/samba/netcmd/domain/backup.py +++ b/python/samba/netcmd/domain/backup.py @@ -691,8 +691,11 @@ class cmd_domain_backup_restore(cmd_fsmo_seize): dest_sysvol_dir = lp.get('path', 'sysvol') if not os.path.exists(dest_sysvol_dir): os.makedirs(dest_sysvol_dir) - backup_restore(sysvol_tar, dest_sysvol_dir, samdb, smbconf) - os.remove(sysvol_tar) + if os.path.isfile(sysvol_tar): + backup_restore(sysvol_tar, dest_sysvol_dir, samdb, smbconf) + os.remove(sysvol_tar) + else: + logger.notice("back-up has no sysvol data") # fix up any stale links to the old DCs we just removed logger.info("Fixing up any remaining references to the old DCs...")