Commit b2f21657 authored by owsla's avatar owsla

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@955 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
parent a118487a
New in v1.2.3 (????/??/??) New in v1.2.3 (????/??/??)
--------------------------- ---------------------------
Handle ELOOP ("Too many levels of symbolic links") error when reading extended
attributes from symlinks. Closes Savannah bug #24790. (Andrew Ferguson)
Inform the user of which file has failed if an exception occurs during a Inform the user of which file has failed if an exception occurs during a
rename operation. (Andrew Ferguson) rename operation. (Andrew Ferguson)
......
...@@ -56,11 +56,12 @@ class ExtendedAttributes: ...@@ -56,11 +56,12 @@ class ExtendedAttributes:
def read_from_rp(self, rp): def read_from_rp(self, rp):
"""Set the extended attributes from an rpath""" """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: except IOError, exc:
if exc[0] in (errno.EOPNOTSUPP, errno.EPERM, errno.ETXTBSY): if exc[0] in (errno.EOPNOTSUPP, errno.EPERM, errno.ETXTBSY):
return # if not supported, consider empty 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) log.Log("Warning: listattr(%s): %s" % (repr(rp.path), exc), 3)
return return
raise raise
...@@ -71,7 +72,9 @@ class ExtendedAttributes: ...@@ -71,7 +72,9 @@ class ExtendedAttributes:
if not rp.isdir() and attr == 'com.apple.ResourceFork': if not rp.isdir() and attr == 'com.apple.ResourceFork':
# Resource Fork handled elsewhere, except for directories # Resource Fork handled elsewhere, except for directories
continue 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: except IOError, exc:
# File probably modified while reading, just continue # File probably modified while reading, just continue
if exc[0] == errno.ENODATA: continue if exc[0] == errno.ENODATA: continue
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment