From 76f2dd999ed88465731fca5ed18604728aa92314 Mon Sep 17 00:00:00 2001 From: owsla Date: Sun, 9 Nov 2008 16:03:45 +0000 Subject: Handle ELOOP ("Too many levels of symbolic links") error when reading extended attributes from symlinks. git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@955 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109 --- rdiff-backup/rdiff_backup/eas_acls.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'rdiff-backup/rdiff_backup') diff --git a/rdiff-backup/rdiff_backup/eas_acls.py b/rdiff-backup/rdiff_backup/eas_acls.py index 82b0190..8fa4035 100644 --- a/rdiff-backup/rdiff_backup/eas_acls.py +++ b/rdiff-backup/rdiff_backup/eas_acls.py @@ -56,11 +56,12 @@ class ExtendedAttributes: def read_from_rp(self, rp): """Set the extended attributes from an rpath""" - try: attr_list = rp.conn.xattr.listxattr(rp.path, rp.issym()) + try: + attr_list = rp.conn.xattr.listxattr(rp.path, rp.issym()) except IOError, exc: if exc[0] in (errno.EOPNOTSUPP, errno.EPERM, errno.ETXTBSY): return # if not supported, consider empty - if exc[0] == errno.EACCES or exc[0] == errno.ENOENT: + if exc[0] in (errno.EACCES, errno.ENOENT, errno.ELOOP): log.Log("Warning: listattr(%s): %s" % (repr(rp.path), exc), 3) return raise @@ -71,7 +72,9 @@ class ExtendedAttributes: if not rp.isdir() and attr == 'com.apple.ResourceFork': # Resource Fork handled elsewhere, except for directories continue - try: self.attr_dict[attr] = rp.conn.xattr.getxattr(rp.path, attr, rp.issym()) + try: + self.attr_dict[attr] = \ + rp.conn.xattr.getxattr(rp.path, attr, rp.issym()) except IOError, exc: # File probably modified while reading, just continue if exc[0] == errno.ENODATA: continue -- cgit v1.2.1