summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorowsla <owsla@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2007-07-31 14:51:14 +0000
committerowsla <owsla@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2007-07-31 14:51:14 +0000
commit097f7cb2eb289cddaf7f0d2f9aa551f5016e6652 (patch)
tree48faddf5b0d747b189166d5b0060a7b596d9f952
parent18098c3014db896cacadbc0faa313b4ce910b3ca (diff)
downloadrdiff-backup-097f7cb2eb289cddaf7f0d2f9aa551f5016e6652.tar.gz
Fix hang on Cygwin/FAT32 and error on broken CIFS configurations
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@835 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
-rw-r--r--rdiff-backup/CHANGELOG7
-rw-r--r--rdiff-backup/rdiff_backup/fs_abilities.py19
2 files changed, 21 insertions, 5 deletions
diff --git a/rdiff-backup/CHANGELOG b/rdiff-backup/CHANGELOG
index 5b127a9..1a87b7c 100644
--- a/rdiff-backup/CHANGELOG
+++ b/rdiff-backup/CHANGELOG
@@ -1,6 +1,13 @@
New in v1.1.13 (????/??/??)
---------------------------
+Prevent the extended filenames / UTF-8 test from raising an exception
+on broken CIFS configurations which transform some characters to '?'.
+Problem reported by Luca Cappe. (Andrew Ferguson)
+
+Cygwin on FAT32 hangs when trying to open a file named "aux". Change
+the escape DOS devices test to use "con" instead. (Andrew Ferguson)
+
Fix symlink behavior when filesystem is mounted via CIFS. Closes
Savannah bug #20342. (Andrew Ferguson)
diff --git a/rdiff-backup/rdiff_backup/fs_abilities.py b/rdiff-backup/rdiff_backup/fs_abilities.py
index 0460fcd..25871bf 100644
--- a/rdiff-backup/rdiff_backup/fs_abilities.py
+++ b/rdiff-backup/rdiff_backup/fs_abilities.py
@@ -218,8 +218,17 @@ class FSAbilities:
self.extended_filenames = 0
else:
assert ext_rp.lstat()
- ext_rp.delete()
- self.extended_filenames = 1
+ try:
+ ext_rp.delete()
+ except (IOError, OSError):
+ # Broken CIFS setups will sometimes create UTF-8 files
+ # and even stat them, but not let us perform file operations
+ # on them. Test file will be deleted via shutil.rmtree()
+ # when subdir is deleted. UTF-8 characters not in the
+ # underlying codepage get translated to '?'
+ self.extended_filenames = 0
+ else:
+ self.extended_filenames = 1
def set_acls(self, rp):
"""Set self.acls based on rp. Does not write. Needs to be local"""
@@ -433,7 +442,7 @@ class FSAbilities:
def set_escape_dos_devices(self, subdir):
"""If special file aux can be stat'd, escape special files"""
try:
- device_rp = subdir.append("aux")
+ device_rp = subdir.append("con")
if device_rp.lstat():
log.Log("escape_dos_devices required by filesystem at %s" \
% (subdir.path), 4)
@@ -531,7 +540,7 @@ class BackupSetGlobals(SetGlobals):
def set_must_escape_dos_devices(self, rbdir):
"""If local edd or src edd, then must escape """
try:
- device_rp = rbdir.append("aux")
+ device_rp = rbdir.append("con")
if device_rp.lstat(): local_edd = 1
else: local_edd = 0
except (OSError): local_edd = 1
@@ -624,7 +633,7 @@ class RestoreSetGlobals(SetGlobals):
src_edd = self.src_fsa.escape_dos_devices
else: src_edd = 0
try:
- device_rp = rbdir.append("aux")
+ device_rp = rbdir.append("con")
if device_rp.lstat(): local_edd = 1
else: local_edd = 0
except (OSError): local_edd = 1