summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2023-10-10 11:15:20 +0200
committerAnton Khirnov <anton@khirnov.net>2023-10-10 11:15:20 +0200
commit81eda8c70280f6eb32962963d344cbf99db2e636 (patch)
tree379e4b6fd172effbb955ee0a15d4c225187def3c
parent80d204cc94f3514dc46387534eb9f8e4d72719ff (diff)
Log when a symlink is skipped due to lack of chmod/chown support
-rwxr-xr-xperm_offset.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/perm_offset.py b/perm_offset.py
index 3f23ab1..20305ad 100755
--- a/perm_offset.py
+++ b/perm_offset.py
@@ -24,11 +24,13 @@ def remap_file(fpath, src, dst, count, dry_run):
return
if S_ISLNK(stat.st_mode) and not os.chown in os.supports_follow_symlinks:
+ logging.debug('Skipping link, os.chown() does not support symlinks: %s', fpath)
return
os.chown(fpath, uid, gid, follow_symlinks = False)
# chown may clear setuid bits, so make sure to preserve them
if S_ISLNK(stat.st_mode) and not os.chmod in os.supports_follow_symlinks:
+ logging.debug('Skipping link, os.chmod() does not support symlinks: %s', fpath)
return
os.chmod(fpath, mode, follow_symlinks = False)