Commit ca516f39 authored by dgaudet's avatar dgaudet

Fix for bug #19895 -- eliminate traceback for special file detection

on CIFS mounts.  (Jonathan Hankins)


git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup@801 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
parent e1c9e9e9
New in v1.1.11 (????/??/??) New in v1.1.11 (????/??/??)
--------------------------- ---------------------------
Fix for bug #19895 -- eliminate traceback for special file detection
on CIFS mounts. (Jonathan Hankins)
New in v1.1.10 (2007/05/12) New in v1.1.10 (2007/05/12)
--------------------------- ---------------------------
......
...@@ -420,17 +420,20 @@ class FSAbilities: ...@@ -420,17 +420,20 @@ class FSAbilities:
def set_escape_dos_devices(self, subdir): def set_escape_dos_devices(self, subdir):
"""If special file aux can be stat'd, escape special files""" """If special file aux can be stat'd, escape special files"""
device_rp = subdir.append("aux") try:
if device_rp.lstat(): device_rp = subdir.append("aux")
assert device_rp.lstat() if device_rp.lstat():
log.Log("escape_dos_devices required by filesystem at %s" \
% (subdir.path), 4)
self.escape_dos_devices = 1
else:
log.Log("escape_dos_devices not required by filesystem at %s" \
% (subdir.path), 4)
self.escape_dos_devices = 0
except(OSError):
log.Log("escape_dos_devices required by filesystem at %s" \ log.Log("escape_dos_devices required by filesystem at %s" \
% (subdir.path), 4) % (subdir.path), 4)
self.escape_dos_devices = 1 self.escape_dos_devices = 1
else:
assert not device_rp.lstat()
log.Log("escape_dos_devices not required by filesystem at %s" \
% (subdir.path), 4)
self.escape_dos_devices = 0
def get_readonly_fsa(desc_string, rp): def get_readonly_fsa(desc_string, rp):
"""Return an fsa with given description_string """Return an fsa with given description_string
...@@ -515,9 +518,11 @@ class BackupSetGlobals(SetGlobals): ...@@ -515,9 +518,11 @@ class BackupSetGlobals(SetGlobals):
def set_must_escape_dos_devices(self, rbdir): def set_must_escape_dos_devices(self, rbdir):
"""If local edd or src edd, then must escape """ """If local edd or src edd, then must escape """
device_rp = rbdir.append("aux") try:
if device_rp.lstat(): local_edd = 1 device_rp = rbdir.append("aux")
else: local_edd = 0 if device_rp.lstat(): local_edd = 1
else: local_edd = 0
except (OSError): local_edd = 1
SetConnections.UpdateGlobal('must_escape_dos_devices', \ SetConnections.UpdateGlobal('must_escape_dos_devices', \
self.src_fsa.escape_dos_devices or local_edd) self.src_fsa.escape_dos_devices or local_edd)
log.Log("Backup: must_escape_dos_devices = %d" % \ log.Log("Backup: must_escape_dos_devices = %d" % \
...@@ -606,9 +611,11 @@ class RestoreSetGlobals(SetGlobals): ...@@ -606,9 +611,11 @@ class RestoreSetGlobals(SetGlobals):
if getattr(self, "src_fsa", None) is not None: if getattr(self, "src_fsa", None) is not None:
src_edd = self.src_fsa.escape_dos_devices src_edd = self.src_fsa.escape_dos_devices
else: src_edd = 0 else: src_edd = 0
device_rp = rbdir.append("aux") try:
if device_rp.lstat(): local_edd = 1 device_rp = rbdir.append("aux")
else: local_edd = 0 if device_rp.lstat(): local_edd = 1
else: local_edd = 0
except (OSError): local_edd = 1
SetConnections.UpdateGlobal('must_escape_dos_devices', \ SetConnections.UpdateGlobal('must_escape_dos_devices', \
src_edd or local_edd) src_edd or local_edd)
log.Log("Restore: must_escape_dos_devices = %d" % \ log.Log("Restore: must_escape_dos_devices = %d" % \
......
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