summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorowsla <owsla@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2008-06-10 13:14:52 +0000
committerowsla <owsla@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2008-06-10 13:14:52 +0000
commitc6f37e80e19c8ed7a427e50284dc06d9a49c519d (patch)
tree9779677542aa24defda2b7b923a6f476d1741948
parent03768c4b2befa8a6cc619a25097a232b36243909 (diff)
downloadrdiff-backup-c6f37e80e19c8ed7a427e50284dc06d9a49c519d.tar.gz
Don't set modification times for directories on Windows. Also, assume
that user has access to all files on Windows since there is no support for getuid(). (Patch from Josh Nisly) git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@888 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
-rw-r--r--rdiff-backup/CHANGELOG4
-rw-r--r--rdiff-backup/rdiff_backup/rpath.py10
2 files changed, 13 insertions, 1 deletions
diff --git a/rdiff-backup/CHANGELOG b/rdiff-backup/CHANGELOG
index 226a686..4432452 100644
--- a/rdiff-backup/CHANGELOG
+++ b/rdiff-backup/CHANGELOG
@@ -1,6 +1,10 @@
New in v1.1.16 (????/??/??)
---------------------------
+Don't set modification times for directories on Windows. Also, assume
+that user has access to all files on Windows since there is no support
+for getuid(). (Patch from Josh Nisly)
+
Add Windows-specific logic for checking if another rdiff-backup process
is running. Do not try to handle non-existant SIGHUP and SIGQUIT signals
on Windows. (Patch from Josh Nisly)
diff --git a/rdiff-backup/rdiff_backup/rpath.py b/rdiff-backup/rdiff_backup/rpath.py
index b0fe10b..a65df45 100644
--- a/rdiff-backup/rdiff_backup/rpath.py
+++ b/rdiff-backup/rdiff_backup/rpath.py
@@ -886,6 +886,11 @@ class RPath(RORPath):
except OverflowError:
log.Log("Cannot change mtime of %s to %s - problem is probably"
"64->32bit conversion" % (self.path, modtime), 2)
+ except OSError:
+ # It's not possible to set a modification time for
+ # directories on Windows.
+ if self.conn.os.name != 'nt' or not self.isdir():
+ raise
else: self.data['mtime'] = modtime
def chown(self, uid, gid):
@@ -969,7 +974,10 @@ class RPath(RORPath):
def isowner(self):
"""Return true if current process is owner of rp or root"""
- uid = self.conn.os.getuid()
+ try:
+ uid = self.conn.os.getuid()
+ except AttributeError:
+ return True # Windows doesn't have getuid(), so hope for the best
return uid == 0 or \
(self.data.has_key('uid') and uid == self.data['uid'])