diff options
Diffstat (limited to 'rdiff-backup/rdiff_backup')
-rw-r--r-- | rdiff-backup/rdiff_backup/Main.py | 3 | ||||
-rw-r--r-- | rdiff-backup/rdiff_backup/Security.py | 9 | ||||
-rw-r--r-- | rdiff-backup/rdiff_backup/eas_acls.py | 14 | ||||
-rw-r--r-- | rdiff-backup/rdiff_backup/rpath.py | 13 |
4 files changed, 22 insertions, 17 deletions
diff --git a/rdiff-backup/rdiff_backup/Main.py b/rdiff-backup/rdiff_backup/Main.py index dea570d..6553fdb 100644 --- a/rdiff-backup/rdiff_backup/Main.py +++ b/rdiff-backup/rdiff_backup/Main.py @@ -579,6 +579,9 @@ def restore_set_root(rpin): parent_dir = rpath.RPath(rpin.conn, "/".join(pathcomps[:i])) if (parent_dir.isdir() and "rdiff-backup-data" in parent_dir.listdir()): break + print "##########", parent_dir.path, Globals.restrict_path + if parent_dir.path == rpin.conn.Globals.get('restrict_path'): + return None i = i-1 else: return None diff --git a/rdiff-backup/rdiff_backup/Security.py b/rdiff-backup/rdiff_backup/Security.py index 1805703..a3cb798 100644 --- a/rdiff-backup/rdiff_backup/Security.py +++ b/rdiff-backup/rdiff_backup/Security.py @@ -20,7 +20,7 @@ """Functions to make sure remote requests are kosher""" import sys, tempfile -import Globals, Main, rpath +import Globals, Main, rpath, log class Violation(Exception): """Exception that indicates an improper request has been received""" @@ -125,6 +125,7 @@ def set_allowed_requests(sec_level): ["C.make_file_dict", "rpath.ea_get", "rpath.acl_get", + "rpath.setdata_local", "log.Log.log_to_file", "os.getuid", "os.listdir", @@ -182,7 +183,7 @@ def vet_request(request, arglist): if isinstance(arg, rpath.RPath): vet_rpath(arg) if security_level == "all": return if request.function_string in allowed_requests: return - if request.function_string == "Globals.set": + if request.function_string in ("Globals.set", "Globals.set_local"): if Globals.server and arglist[0] not in disallowed_server_globals: return raise Violation("\nWarning Security Violation!\n" @@ -204,7 +205,3 @@ def vet_rpath(rpath): "Request to handle path %s\n" "which doesn't appear to be within " "restrict path %s.\n" % (normalized, restrict)) - - - - diff --git a/rdiff-backup/rdiff_backup/eas_acls.py b/rdiff-backup/rdiff_backup/eas_acls.py index e8258ad..4cf14cc 100644 --- a/rdiff-backup/rdiff_backup/eas_acls.py +++ b/rdiff-backup/rdiff_backup/eas_acls.py @@ -170,10 +170,10 @@ class ExtendedAttributesFile(metadata.FlatFile): yield rorp ea_iter = cls.get_objects_at_time(rbdir, time, restrict_index) - if ea_iter: return helper(rorp_iter, ea_iter) - else: - log.Log("Warning: Extended attributes file not found",2) - return rorp_iter + if not ea_iter: + log.Log("Warning: Extended attributes file not found", 2) + ea_iter = iter([]) + return helper(rorp_iter, ea_iter) static.MakeClass(ExtendedAttributesFile) @@ -501,10 +501,10 @@ class AccessControlListFile(metadata.FlatFile): yield rorp acl_iter = cls.get_objects_at_time(rbdir, time, restrict_index) - if acl_iter: return helper(rorp_iter, acl_iter) - else: + if not acl_iter: log.Log("Warning: Access Control List file not found", 2) - return rorp_iter + acl_iter = iter([]) + return helper(rorp_iter, acl_iter) static.MakeClass(AccessControlListFile) diff --git a/rdiff-backup/rdiff_backup/rpath.py b/rdiff-backup/rdiff_backup/rpath.py index b1f3d0b..6678a3d 100644 --- a/rdiff-backup/rdiff_backup/rpath.py +++ b/rdiff-backup/rdiff_backup/rpath.py @@ -296,13 +296,18 @@ class RORPath: elif key == 'acl' and not Globals.acls_active: pass elif key == 'resourcefork' and not Globals.resource_forks_active: pass + elif ((key == 'uname' or key == 'gname') and + not other.data.has_key(key)): + pass # legacy reasons - 0.12.x didn't store u/gnames elif (key == 'inode' and (not self.isreg() or self.getnumlinks() == 1 or not Globals.compare_inode or - not Globals.preserve_hardlinks)): pass - elif (not other.data.has_key(key) or - self.data[key] != other.data[key]): - return None + not Globals.preserve_hardlinks)): + pass + else: + try: other_val = other.data[key] + except KeyError: return None + if self.data[key] != other.data[key]: return None return 1 def equal_loose(self, other): |