Commit d4452e79 authored by owsla's avatar owsla

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@888 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
parent 5c46c373
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)
......
......@@ -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'])
......
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