rdiff-backup-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Rdiff-backup-commits] rdiff-backup CHANGELOG rdiff_backup/eas_acls.py


From: Andrew Ferguson
Subject: [Rdiff-backup-commits] rdiff-backup CHANGELOG rdiff_backup/eas_acls.py
Date: Wed, 11 Jun 2008 20:10:59 +0000

CVSROOT:        /sources/rdiff-backup
Module name:    rdiff-backup
Changes by:     Andrew Ferguson <owsla> 08/06/11 20:10:59

Modified files:
        .              : CHANGELOG 
        rdiff_backup   : eas_acls.py 

Log message:
        Make rdiff-backup robust to failure to read the extended attributes or 
ACL
        because the file cannot be found.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/rdiff-backup/CHANGELOG?cvsroot=rdiff-backup&r1=1.272&r2=1.273
http://cvs.savannah.gnu.org/viewcvs/rdiff-backup/rdiff_backup/eas_acls.py?cvsroot=rdiff-backup&r1=1.29&r2=1.30

Patches:
Index: CHANGELOG
===================================================================
RCS file: /sources/rdiff-backup/rdiff-backup/CHANGELOG,v
retrieving revision 1.272
retrieving revision 1.273
diff -u -b -r1.272 -r1.273
--- CHANGELOG   11 Jun 2008 19:36:20 -0000      1.272
+++ CHANGELOG   11 Jun 2008 20:10:58 -0000      1.273
@@ -1,6 +1,10 @@
 New in v1.1.16 (????/??/??)
 ---------------------------
 
+Don't abort if can't read extended attributes or ACL because the path is
+considered bad by the EA/ACL subsystem; print a warning instead. Problem
+reported by Farkas Levente. (Andrew Ferguson)
+
 rdiff-backup-statistics enhancements suggested by James Marsh: flush stdout
 before running other commands, and add a --quiet option to suppress printing
 the "Processing statistics from session..." lines. (Andrew Ferguson)

Index: rdiff_backup/eas_acls.py
===================================================================
RCS file: /sources/rdiff-backup/rdiff-backup/rdiff_backup/eas_acls.py,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -b -r1.29 -r1.30
--- rdiff_backup/eas_acls.py    24 Apr 2008 17:08:32 -0000      1.29
+++ rdiff_backup/eas_acls.py    11 Jun 2008 20:10:58 -0000      1.30
@@ -57,10 +57,10 @@
        def read_from_rp(self, rp):
                """Set the extended attributes from an rpath"""
                try: attr_list = rp.conn.xattr.listxattr(rp.path)
-               except IOError, exc:
+               except (IOError, ListError), exc:
                        if exc[0] == errno.EOPNOTSUPP or exc[0] == errno.EPERM:
                                return # if not supported, consider empty
-                       if exc[0] == errno.EACCES:
+                       if exc[0] == errno.EACCES or exc[0] == errno.ENOENT:
                                log.Log("Warning: listattr(%s): %s" % 
(repr(rp.path), exc), 3)
                                return
                        raise
@@ -93,9 +93,13 @@
                                                        % (name, 
repr(rp.path)), 7)
                                                continue
                                        else: raise
-               except IOError, exc:
+               except (IOError, ListError), exc:
                        if exc[0] == errno.EOPNOTSUPP or exc[0] == errno.EPERM:
                                return # if not supported, consider empty
+                       if exc[0] == errno.ENOENT: # path is bad
+                               log.Log("Warning: unable to clear xattrs on %s: 
%s" %
+                                               (repr(rp.path), exc), 3)
+                               return
                        else: raise
 
        def write_to_rp(self, rp):
@@ -104,10 +108,11 @@
                for (name, value) in self.attr_dict.iteritems():
                        try:
                                rp.conn.xattr.setxattr(rp.path, name, value)
-                       except IOError, exc:
+                       except (IOError, ListError), exc:
                                # Mac and Linux attributes have different 
namespaces, so
                                # fail gracefully if can't call setxattr
-                               if exc[0] == errno.EOPNOTSUPP or exc[0] == 
errno.EACCES:
+                               if exc[0] == errno.EOPNOTSUPP or exc[0] == 
errno.EACCES \
+                                                or exc[0] == errno.ENOENT:
                                        log.Log("Warning: unable to write xattr 
%s to %s"
                                                        % (name, 
repr(rp.path)), 6)
                                        continue
@@ -376,13 +381,21 @@
        """Returns (acl_list, def_acl_list) from an rpath.  Call locally"""
        assert rp.conn is Globals.local_connection
        try: acl = posix1e.ACL(file=rp.path)
-       except IOError, exc:
+       except (IOError, ListError), exc:
                if exc[0] == errno.EOPNOTSUPP: acl = None
+               if exc[0] == errno.ENOENT:
+                       log.Log("Warning: unable to read ACL from %s: %s"
+                                       % (repr(rp.path), exc), 3)
+                       acl = None
                else: raise
        if rp.isdir():
                try: def_acl = posix1e.ACL(filedef=rp.path)
-               except IOError, exc:
+               except (IOError, ListError), exc:
                        if exc[0] == errno.EOPNOTSUPP: def_acl = None
+                       if exc[0] == errno.ENOENT:
+                               log.Log("Warning: unable to read default ACL 
from %s: %s"
+                                       % (repr(rp.path), exc), 3)
+                               def_acl = None
                        else: raise
        else: def_acl = None
        return (acl and acl_to_list(acl), def_acl and acl_to_list(def_acl))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]