summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorowsla <owsla@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2008-08-20 02:27:52 +0000
committerowsla <owsla@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2008-08-20 02:27:52 +0000
commitd4895cb7110e190207b0574432ac5ff9cec5ec8a (patch)
tree0ca24e3452e3c4d5b8edf0cc292f260fe4e2297e
parent104a9ad3fff95bbcf42d103c663bdfe2404c2bee (diff)
downloadrdiff-backup-d4895cb7110e190207b0574432ac5ff9cec5ec8a.tar.gz
Disable hardlinks by default when backup source or restore destination is
on Windows. git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@926 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
-rw-r--r--rdiff-backup/CHANGELOG3
-rw-r--r--rdiff-backup/rdiff_backup/Main.py4
-rw-r--r--rdiff-backup/rdiff_backup/Security.py2
-rw-r--r--rdiff-backup/rdiff_backup/fs_abilities.py6
4 files changed, 14 insertions, 1 deletions
diff --git a/rdiff-backup/CHANGELOG b/rdiff-backup/CHANGELOG
index 9136e12..6eb4273 100644
--- a/rdiff-backup/CHANGELOG
+++ b/rdiff-backup/CHANGELOG
@@ -1,6 +1,9 @@
New in v1.2.1 (????/??/??)
---------------------------
+Disable hardlinks by default when backup source or restore destination is
+on Windows. (Andrew Ferguson)
+
Properly catch KeyboardInterrupt on Python 2.5. (Andrew Ferguson)
Don't crash if a CacheIndexable tries to clear a non-existent cache entry,
diff --git a/rdiff-backup/rdiff_backup/Main.py b/rdiff-backup/rdiff_backup/Main.py
index 6e050c0..ac640bd 100644
--- a/rdiff-backup/rdiff_backup/Main.py
+++ b/rdiff-backup/rdiff_backup/Main.py
@@ -827,3 +827,7 @@ def checkdest_if_necessary(dest_rp):
Log("Previous backup seems to have failed, regressing "
"destination now.", 2)
dest_rp.conn.regress.Regress(dest_rp)
+
+def get_os_name():
+ """Created as a function so that it can be called remotely."""
+ return os.name
diff --git a/rdiff-backup/rdiff_backup/Security.py b/rdiff-backup/rdiff_backup/Security.py
index 8dc26bc..03d3d00 100644
--- a/rdiff-backup/rdiff_backup/Security.py
+++ b/rdiff-backup/rdiff_backup/Security.py
@@ -141,7 +141,7 @@ def set_allowed_requests(sec_level):
"log.Log.log_to_file", "os.getuid", "Time.setcurtime_local",
"rpath.gzip_open_local_read", "rpath.open_local_read",
"Hardlink.initialize_dictionaries", "user_group.uid2uname",
- "user_group.gid2gname"])
+ "user_group.gid2gname", "Main.get_os_name"])
if sec_level == "read-only" or sec_level == "all":
l.extend(["fs_abilities.get_readonly_fsa",
"restore.MirrorStruct.get_increment_times",
diff --git a/rdiff-backup/rdiff_backup/fs_abilities.py b/rdiff-backup/rdiff_backup/fs_abilities.py
index 2be4740..e01bd5f 100644
--- a/rdiff-backup/rdiff_backup/fs_abilities.py
+++ b/rdiff-backup/rdiff_backup/fs_abilities.py
@@ -776,6 +776,9 @@ def backup_set_globals(rpin, force):
"""
assert Globals.rbdir.conn is Globals.local_connection
+ if rpin.conn.Main.get_os_name() == "nt":
+ log.Log("Hardlinks disabled by default on Windows", 4)
+ Globals.set('preserve_hardlinks', 0)
src_fsa = rpin.conn.fs_abilities.get_readonly_fsa('source', rpin)
log.Log(str(src_fsa), 4)
dest_fsa = FSAbilities('destination').init_readwrite(Globals.rbdir)
@@ -803,6 +806,9 @@ def backup_set_globals(rpin, force):
def restore_set_globals(rpout):
"""Set fsa related globals for restore session, given in/out rps"""
assert rpout.conn is Globals.local_connection
+ if rpout.conn.Main.get_os_name() == "nt":
+ log.Log("Hardlinks disabled by default on Windows", 4)
+ Globals.set('preserve_hardlinks', 0)
src_fsa = Globals.rbdir.conn.fs_abilities.get_readonly_fsa(
'rdiff-backup repository', Globals.rbdir)
log.Log(str(src_fsa), 4)