diff options
author | bescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2005-08-10 05:47:56 +0000 |
---|---|---|
committer | bescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2005-08-10 05:47:56 +0000 |
commit | 6407faaf13d62710e524009a5174a5948754ed44 (patch) | |
tree | 9171a94c86b77fe8fea736c8c2301fda06dce7f0 /rdiff-backup | |
parent | 4918807565a39f78b1a37159c20b3b472d73522e (diff) | |
download | rdiff-backup-6407faaf13d62710e524009a5174a5948754ed44.tar.gz |
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
Diffstat (limited to 'rdiff-backup')
-rw-r--r-- | rdiff-backup/CHANGELOG | 3 | ||||
-rw-r--r-- | 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""" |