Commit 0f85005b authored by owsla's avatar owsla

Disable hardlinks by default when backup source or restore destination is

on Windows.


git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup@926 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
parent 7a817a2d
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,
......
......@@ -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
......@@ -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",
......
......@@ -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)
......
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