Commit 403a4978 authored by bescoto's avatar bescoto

Final changes for 0.13.3


git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup@474 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
parent ed425d54
New in v0.13.3 (??????????)
New in v0.13.3 (2003/10/14)
---------------------------
Fixed some of the --restrict options which would cause spurious
......
Figure out why files getting unnecessarily incremented when upgrading
from 0.12.x.
Consider adding --datadir option (Jean-Sébastien GOETSCHY)
See if regressing takes too much memory (large directories).
......
......@@ -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
......
......@@ -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))
......@@ -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)
......
......@@ -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):
......
......@@ -8,7 +8,7 @@ user_group.init_group_mapping()
tempdir = rpath.RPath(Globals.local_connection, "testfiles/output")
restore_dir = rpath.RPath(Globals.local_connection,
"testfiles/restore_out")
log.Log.setverbosity(7)
log.Log.setverbosity(3)
class EATest(unittest.TestCase):
"""Test extended attributes"""
......
......@@ -12,7 +12,7 @@ class SecurityTest(unittest.TestCase):
problem.
"""
assert isinstance(exc, Security.Violation)
assert isinstance(exc, Security.Violation), exc
#assert str(exc).find("Security") >= 0, "%s\n%s" % (exc, repr(exc))
def test_vet_request_ro(self):
......@@ -45,10 +45,10 @@ class SecurityTest(unittest.TestCase):
conn.Globals.set("TEST_var", rp)
assert conn.Globals.get("TEST_var").path == rp.path
for rp in [RPath(conn, "foobar"),
RPath(conn, "/usr/local"),
RPath(conn, "foo/../bar")]:
try: conn.Globals.set("TEST_var", rp)
for path in ["foobar", "/usr/local", "foo/../bar"]:
try:
rp = rpath.RPath(conn, path)
conn.Globals.set("TEST_var", rp)
except Exception, e:
self.assert_exc_sec(e)
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