samba-tool domain backup: backup but do not follow symlinks
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Tue, 30 Nov 2021 21:20:48 +0000 (10:20 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 3 Dec 2021 18:00:34 +0000 (18:00 +0000)
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>
python/samba/netcmd/domain_backup.py

index af8aa505a95a0ba457560501cf4dfe983f389c6e..6cb0e51259513f8b8241d134b84daf8b8f2717ad 100644 (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: