Commit 8cf39d7e authored by bescoto's avatar bescoto

Fix for bug#13613 - 64->32bit utime overflow error


git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup@605 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
parent c38d96d2
...@@ -40,6 +40,9 @@ Fixed selection bug reported by Daniel Richard G. ...@@ -40,6 +40,9 @@ Fixed selection bug reported by Daniel Richard G.
bug#13576: You can now back ACLs to a computer that doesn't have the bug#13576: You can now back ACLs to a computer that doesn't have the
posix1e module. posix1e module.
bug#13613: Fix for overflow error that could happen when backing up
files with dates far in the future on a 64bit machine to a 32 bit one.
New in v0.13.6 (2005/04/07) New in v0.13.6 (2005/04/07)
--------------------------- ---------------------------
......
...@@ -755,15 +755,23 @@ class RPath(RORPath): ...@@ -755,15 +755,23 @@ class RPath(RORPath):
def settime(self, accesstime, modtime): def settime(self, accesstime, modtime):
"""Change file modification times""" """Change file modification times"""
log.Log("Setting time of %s to %d" % (self.path, modtime), 7) log.Log("Setting time of %s to %d" % (self.path, modtime), 7)
self.conn.os.utime(self.path, (accesstime, modtime)) try: self.conn.os.utime(self.path, (accesstime, modtime))
self.data['atime'] = accesstime except OverflowError:
self.data['mtime'] = modtime log.Log("Cannot change times of %s to %s - problem is probably"
"64->32bit conversion" %
(self.path, (accesstime, modtime)), 2)
else:
self.data['atime'] = accesstime
self.data['mtime'] = modtime
def setmtime(self, modtime): def setmtime(self, modtime):
"""Set only modtime (access time to present)""" """Set only modtime (access time to present)"""
log.Log(lambda: "Setting time of %s to %d" % (self.path, modtime), 7) log.Log(lambda: "Setting time of %s to %d" % (self.path, modtime), 7)
self.conn.os.utime(self.path, (long(time.time()), modtime)) try: self.conn.os.utime(self.path, (long(time.time()), modtime))
self.data['mtime'] = modtime except OverflowError:
log.Log("Cannot change mtime of %s to %s - problem is probably"
"64->32bit conversion" % (self.path, modtime), 2)
else: self.data['mtime'] = modtime
def chown(self, uid, gid): def chown(self, uid, gid):
"""Set file's uid and gid""" """Set file's uid and gid"""
......
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