From 6407faaf13d62710e524009a5174a5948754ed44 Mon Sep 17 00:00:00 2001 From: bescoto Date: Wed, 10 Aug 2005 05:47:56 +0000 Subject: Fix for bug#13613 - 64->32bit utime overflow error git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@605 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109 --- rdiff-backup/CHANGELOG | 3 +++ rdiff-backup/rdiff_backup/rpath.py | 18 +++++++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/rdiff-backup/CHANGELOG b/rdiff-backup/CHANGELOG index ca57603..730b483 100644 --- a/rdiff-backup/CHANGELOG +++ b/rdiff-backup/CHANGELOG @@ -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 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) --------------------------- diff --git a/rdiff-backup/rdiff_backup/rpath.py b/rdiff-backup/rdiff_backup/rpath.py index deb25f4..0b17934 100644 --- a/rdiff-backup/rdiff_backup/rpath.py +++ b/rdiff-backup/rdiff_backup/rpath.py @@ -755,15 +755,23 @@ class RPath(RORPath): def settime(self, accesstime, modtime): """Change file modification times""" log.Log("Setting time of %s to %d" % (self.path, modtime), 7) - self.conn.os.utime(self.path, (accesstime, modtime)) - self.data['atime'] = accesstime - self.data['mtime'] = modtime + try: self.conn.os.utime(self.path, (accesstime, modtime)) + except OverflowError: + 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): """Set only modtime (access time to present)""" log.Log(lambda: "Setting time of %s to %d" % (self.path, modtime), 7) - self.conn.os.utime(self.path, (long(time.time()), modtime)) - self.data['mtime'] = modtime + try: self.conn.os.utime(self.path, (long(time.time()), 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): """Set file's uid and gid""" -- cgit v1.2.1