diff options
author | bescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2003-08-27 20:29:30 +0000 |
---|---|---|
committer | bescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2003-08-27 20:29:30 +0000 |
commit | 47e616b933c51731a7e95e3b507e2fe56d8eb351 (patch) | |
tree | 3aa70166badd950ca288cb881b7e99c6c4a6a7c5 /rdiff-backup/rdiff_backup/Main.py | |
parent | 5eb272cab822b4f8ec54605c562c554223faad18 (diff) | |
download | rdiff-backup-47e616b933c51731a7e95e3b507e2fe56d8eb351.tar.gz |
Fixed problems with --restrict-XXX switches
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/branches/r0-12@408 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup/rdiff_backup/Main.py')
-rw-r--r-- | rdiff-backup/rdiff_backup/Main.py | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/rdiff-backup/rdiff_backup/Main.py b/rdiff-backup/rdiff_backup/Main.py index da1e596..a9a5954 100644 --- a/rdiff-backup/rdiff_backup/Main.py +++ b/rdiff-backup/rdiff_backup/Main.py @@ -419,7 +419,8 @@ def restore_set_select(mirror_rp, target): def restore_start_log(rpin, target, time): """Open restore log file, log initial message""" try: Log.open_logfile(datadir.append("restore.log")) - except LoggerError, e: Log("Warning, " + str(e), 2) + except (LoggerError, Security.Violation), e: + Log("Warning - Unable to open " + str(e), 2) # Log following message at file verbosity 3, but term verbosity 4 log_message = ("Starting restore of %s to %s as it was as of %s." % @@ -475,11 +476,15 @@ def restore_get_root(rpin): global datadir if rpin.isincfile(): relpath = rpin.getincbase().path else: relpath = rpin.path - pathcomps = os.path.join(rpin.conn.os.getcwd(), relpath).split("/") - assert len(pathcomps) >= 2 # path should be relative to / + if rpin.conn is not Globals.local_connection: + # For security checking consistency, don't get absolute path + pathcomps = relpath.split('/') + else: pathcomps = os.path.join(os.getcwd(), relpath).split("/") + if not pathcomps[0]: min_len_pathcomps = 2 # treat abs paths differently + else: min_len_pathcomps = 1 i = len(pathcomps) - while i >= 2: + while i >= min_len_pathcomps: parent_dir = rpath.RPath(rpin.conn, "/".join(pathcomps[:i])) if (parent_dir.isdir() and "rdiff-backup-data" in parent_dir.listdir()): break @@ -613,6 +618,12 @@ The rdiff-backup data directory exists, but we cannot find a valid current_mirror marker. You can avoid this message by removing this directory; however any data in it will be lost. + +Probably this error was caused because the first rdiff-backup session +into a new directory failed. If this is the case it is safe to delete +the rdiff_backup_data directory because there is no important +information in it. + """ % (Globals.rbdir.path,)) elif len(curmir_incs) == 1: return 0 else: |