From c6f37e80e19c8ed7a427e50284dc06d9a49c519d Mon Sep 17 00:00:00 2001 From: owsla Date: Tue, 10 Jun 2008 13:14:52 +0000 Subject: 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 --- rdiff-backup/CHANGELOG | 4 ++++ rdiff-backup/rdiff_backup/rpath.py | 10 +++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) 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']) -- cgit v1.2.1