1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

samba-tool domain backup: backup but do not follow symlinks

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14918

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Douglas Bagnall 2021-12-01 10:20:48 +13:00 committed by Andrew Bartlett
parent 697abc15ea
commit 0f7e58b0e2

View File

@ -1128,9 +1128,9 @@ class cmd_domain_backup_offline(samba.netcmd.Command):
# duplicates if one backup dir is a subdirectory of another,
# or if backup dirs contain hardlinks.
try:
s = os.stat(full_path)
s = os.stat(full_path, follow_symlinks=False)
except FileNotFoundError:
logger.info(f"{full_path} does not exist (dangling symlink?)")
logger.warning(f"{full_path} does not exist!")
continue
if (s.st_ino, s.st_dev) in all_stats: