summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorowsla <owsla@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2007-07-16 17:19:54 +0000
committerowsla <owsla@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2007-07-16 17:19:54 +0000
commit3f4885e7c17d8fb1805f1113ca4799f52f976db4 (patch)
tree88458124d43be9d3b0cb8da3d7e2207d502a2f41
parentceb49efad2c08673fba9df94f2eb759fea44e2ce (diff)
downloadrdiff-backup-3f4885e7c17d8fb1805f1113ca4799f52f976db4.tar.gz
Handle exception when trying to clear extended attributes on a file that
doesn't support them. git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@827 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
-rw-r--r--rdiff-backup/CHANGELOG3
-rw-r--r--rdiff-backup/rdiff_backup/eas_acls.py27
2 files changed, 19 insertions, 11 deletions
diff --git a/rdiff-backup/CHANGELOG b/rdiff-backup/CHANGELOG
index c8d1dfe..fc7c0ad 100644
--- a/rdiff-backup/CHANGELOG
+++ b/rdiff-backup/CHANGELOG
@@ -1,6 +1,9 @@
New in v1.1.13 (????/??/??)
---------------------------
+Don't throw an error when clearing extended attributes if they are not
+supported on the file. (Andrew Ferguson)
+
New in v1.1.12 (2007/07/12)
---------------------------
diff --git a/rdiff-backup/rdiff_backup/eas_acls.py b/rdiff-backup/rdiff_backup/eas_acls.py
index 71878db..0b37898 100644
--- a/rdiff-backup/rdiff_backup/eas_acls.py
+++ b/rdiff-backup/rdiff_backup/eas_acls.py
@@ -81,17 +81,22 @@ class ExtendedAttributes:
def clear_rp(self, rp):
"""Delete all the extended attributes in rpath"""
- for name in rp.conn.xattr.listxattr(rp.path):
- try:
- rp.conn.xattr.removexattr(rp.path, name)
- except IOError, exc:
- # SELinux attributes cannot be removed, and we don't want
- # to bail out or be too noisy at low log levels.
- if exc[0] == errno.EACCES:
- log.Log("Warning: unable to remove xattr %s from %s"
- % (name, rp.path), 7)
- continue
- else: raise
+ try:
+ for name in rp.conn.xattr.listxattr(rp.path):
+ try:
+ rp.conn.xattr.removexattr(rp.path, name)
+ except IOError, exc:
+ # SELinux attributes cannot be removed, and we don't want
+ # to bail out or be too noisy at low log levels.
+ if exc[0] == errno.EACCES:
+ log.Log("Warning: unable to remove xattr %s from %s"
+ % (name, rp.path), 7)
+ continue
+ else: raise
+ except IOError, exc:
+ if exc[0] == errno.EOPNOTSUPP or exc[0] == errno.EPERM:
+ return # if not supported, consider empty
+ else: raise
def write_to_rp(self, rp):
"""Write extended attributes to rpath rp"""