summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2004-07-27 23:15:05 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2004-07-27 23:15:05 +0000
commit0dd8a47056fc5f105e617e02be6708a6ff633534 (patch)
tree302929ddae796297e7f1cafab534af0cb8bf529a
parent94a410b48a9015867bc9de2a1b8d4e7004a1ab2e (diff)
downloadcoreutils-0dd8a47056fc5f105e617e02be6708a6ff633534.tar.xz
backupfile integer overflow fixups
-rw-r--r--lib/ChangeLog30
-rw-r--r--m4/ChangeLog6
2 files changed, 36 insertions, 0 deletions
diff --git a/lib/ChangeLog b/lib/ChangeLog
index 6efb09a1a..972a77b17 100644
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -1,3 +1,33 @@
+2004-07-27 Paul Eggert <eggert@cs.ucla.edu>
+
+ backupfile.c rewrite to avoid arbitrary limits on lengths of
+ numeric backup extensions.
+
+ * addext.c: Remove; no longer needed.
+ * Makefile.am (libfetish_a_SOURCES): Remove addext.c.
+ * backupfile.h (addext): Remove decl.
+ * backupfile.c: Include "backupfile.h" first.
+ Include errno.h, stdbool.h, limits.h, unistd.h, xalloc.h.
+ (CLOSEDIR, INT_STRLEN_BOUND): Remove.
+ (pathconf) [! (HAVE_PATHCONF && defined _PC_NAME_MAX)]: New macro.
+ (_POSIX_NAME_MAX) [!defined _POSIX_NAME_MAX]: New macro.
+ (NAME_MAX_MAXIMUM): New macro. Unlike the old addext.c, we
+ also look at _XOPEN_NAME_MAX, for better performance on modern
+ hosts that support only file names of length 255 or more.
+ (ISDIGIT): unsigned -> unsigned int
+ (max_backup_version, version_number): Remove.
+ (check_extension): New function. Similar to the old addext, but
+ static, assumes that the extension has already been added,
+ and a bit more careful on DOS hosts.
+ (numbered_backup): New function. It does what max_backup_version
+ and version_number used to do, but it doesn't use integer arithmetic
+ to calculate extensions so it doesn't overflow.
+ (find_backup_file_name): Rewrite to use these new functions.
+ This has a new optimization: we needn't call pathconf if the
+ new numbered backup name has the same length as the old.
+ Also, use xmalloc rather than malloc, so that the caller
+ needn't worry about memory exhaustion.
+
2004-07-25 Paul Eggert <eggert@cs.ucla.edu>
* euidaccess.c [!defined LIBC]: Included group-member.h, stat-macros.h.
diff --git a/m4/ChangeLog b/m4/ChangeLog
index 7d1780e93..b84ab3fc0 100644
--- a/m4/ChangeLog
+++ b/m4/ChangeLog
@@ -1,3 +1,9 @@
+2004-07-27 Paul Eggert <eggert@cs.ucla.edu>
+
+ * backupfile.m4 (gl_BACKUPFILE): AC_REQUIRE
+ gl_CHECK_TYPE_STRUCT_DIRENT_D_INO instead of invoking it directly.
+ Do not require AC_FUNC_CLOSEDIR_VOID.
+
2004-07-25 Paul Eggert <eggert@cs.ucla.edu>
* jm-macros.m4 (gl_MACROS): Remove test for setreuid and setregid,