summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2005-10-25 01:57:12 +0000
committerbescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2005-10-25 01:57:12 +0000
commit2631bcf823c1b6404458478ce76b0be7f1c289e4 (patch)
tree551dbdd23236012bd57303eadd993adca19f91e5
parentd4632e3842d0d9bba56704b01e03d636d92cc826 (diff)
downloadrdiff-backup-2631bcf823c1b6404458478ce76b0be7f1c289e4.tar.gz
Tweaks to get around spurious security exception
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@649 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
-rw-r--r--rdiff-backup/testing/commontest.py20
-rw-r--r--rdiff-backup/testing/regressiontest.py1
2 files changed, 9 insertions, 12 deletions
diff --git a/rdiff-backup/testing/commontest.py b/rdiff-backup/testing/commontest.py
index 3f3dbe7..3113b21 100644
--- a/rdiff-backup/testing/commontest.py
+++ b/rdiff-backup/testing/commontest.py
@@ -3,7 +3,7 @@ import os, sys, code
from rdiff_backup.log import Log
from rdiff_backup.rpath import RPath
from rdiff_backup import Globals, Hardlink, SetConnections, Main, \
- selection, lazy, Time, rpath, eas_acls, rorpiter
+ selection, lazy, Time, rpath, eas_acls, rorpiter, Security
RBBin = "../rdiff-backup"
SourceDir = "../rdiff_backup"
@@ -72,15 +72,6 @@ def rdiff_backup(source_local, dest_local, src_dir, dest_dir,
print "Executing: ", cmdline
assert not os.system(cmdline)
-def cmd_schemas2rps(schema_list, remote_schema):
- """Input list of file descriptions and the remote schema, return rps
-
- File descriptions should be strings of the form 'hostname.net::foo'
-
- """
- return map(SetConnections.cmdpair2rp,
- SetConnections.get_cmd_pairs(schema_list, remote_schema))
-
def InternalBackup(source_local, dest_local, src_dir, dest_dir,
current_time = None, eas = None, acls = None):
"""Backup src to dest internally
@@ -103,7 +94,9 @@ def InternalBackup(source_local, dest_local, src_dir, dest_dir,
dest_dir = "cd test2/tmp; python ../../server.py ../../%s::../../%s" \
% (SourceDir, dest_dir)
- rpin, rpout = cmd_schemas2rps([src_dir, dest_dir], remote_schema)
+ cmdpairs = SetConnections.get_cmd_pairs([src_dir, dest_dir], remote_schema)
+ Security.initialize("backup", cmdpairs)
+ rpin, rpout = map(SetConnections.cmdpair2rp, cmdpairs)
for attr in ('eas_active', 'eas_write', 'eas_conn'):
SetConnections.UpdateGlobal(attr, eas)
for attr in ('acls_active', 'acls_write', 'acls_conn'):
@@ -151,7 +144,10 @@ def InternalRestore(mirror_local, dest_local, mirror_dir, dest_dir, time,
dest_dir = "cd test2/tmp; python ../../server.py ../../%s::../../%s" \
% (SourceDir, dest_dir)
- mirror_rp, dest_rp = cmd_schemas2rps([mirror_dir, dest_dir], remote_schema)
+ cmdpairs = SetConnections.get_cmd_pairs([mirror_dir, dest_dir],
+ remote_schema)
+ Security.initialize("restore", cmdpairs)
+ mirror_rp, dest_rp = map(SetConnections.cmdpair2rp, cmdpairs)
for attr in ('eas_active', 'eas_write', 'eas_conn'):
SetConnections.UpdateGlobal(attr, eas)
for attr in ('acls_active', 'acls_write', 'acls_conn'):
diff --git a/rdiff-backup/testing/regressiontest.py b/rdiff-backup/testing/regressiontest.py
index fd67f59..8799ce8 100644
--- a/rdiff-backup/testing/regressiontest.py
+++ b/rdiff-backup/testing/regressiontest.py
@@ -88,6 +88,7 @@ class PathSetter(unittest.TestCase):
self.dest_prefix, self.dest_conn = \
self.get_prefix_and_conn(dest_path, dest_return)
SetConnections.BackupInitConnections(self.src_conn, self.dest_conn)
+ Globals.restrict_path = "/" # we aren't testing security here
assert not os.system("rm -rf testfiles/output* "
"testfiles/restoretarget* "