From 80fb85200ce32107fc7015d1f56f79e6ddf237de Mon Sep 17 00:00:00 2001 From: Marcel Waldvogel Date: Wed, 11 Apr 2018 17:18:46 +0200 Subject: [PATCH] Continue on EPERM when probably caused by immutable --- bedup/tracking.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bedup/tracking.py b/bedup/tracking.py index 1f1f1b2..6fead62 100644 --- a/bedup/tracking.py +++ b/bedup/tracking.py @@ -545,6 +545,13 @@ def dedup_tracked1(ds, comm1): elif e.errno == errno.ENOENT: # The file was moved or unlinked by a racing process ds.tt.notify('File %r may have moved, skipping' % path) + elif e.errno == errno.EPERM: + if os.geteuid() == 0: + # Probably immutable + ds.tt.notify('Permission denied (immutable?) on %r, skipping' % path) + else: + ds.tt.notify('Permission denied on %r, you probably need to be root' % path) + raise else: raise ds.skip(inode)