Sync from coreutils.
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 10 Jan 2006 21:31:01 +0000 (21:31 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 10 Jan 2006 21:31:01 +0000 (21:31 +0000)
Avoid the double-free (first in fts_read, second in fts_close) that
would occur when an `active' directory is made inaccessible (e.g.,
via chmod a-x) during a traversal.
* lib/fts.c (fts_read): After a failed fchdir, update sp->fts_cur
before returning.  Reproduce this failure by
mkdir -p a/b; cd a; chmod a-x . b

* lib/sha1.c: Tweak grammar in a comment.
* m4/fpending.m4: Also include <stdio.h>, for Dragonfly.

* m4/memcoll.m4 (gl_MEMCOLL): Don't require AC_FUNC_MEMCMP, undoing
the 2002-12-31 change.

lib/ChangeLog
lib/fts.c
lib/sha1.c
m4/ChangeLog
m4/fpending.m4
m4/memcoll.m4

index 8626e27..0b3394c 100644 (file)
@@ -1,3 +1,16 @@
+2006-01-10  Jim Meyering  <jim@meyering.net>
+
+       Avoid the double-free (first in fts_read, second in fts_close) that
+       would occur when an `active' directory is made inaccessible (e.g.,
+       via chmod a-x) during a traversal.
+       * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
+       before returning.  Reproduce this failure by
+       mkdir -p a/b; cd a; chmod a-x . b
+       Reported by Stavros Passas.
+
+       Sync from coreutils.
+       * sha1.c: Tweak grammar in a comment.
+
 2006-01-10  Paul Eggert  <eggert@cs.ucla.edu>
 
        * regex_internal.h (BITSET_WORD_BITS):
index ed09697..fb1a72a 100644 (file)
--- a/lib/fts.c
+++ b/lib/fts.c
@@ -522,6 +522,7 @@ next:       tmp = p;
                if (p->fts_level == FTS_ROOTLEVEL) {
                        if (FCHDIR(sp, sp->fts_rfd)) {
                                SET(FTS_STOP);
+                               sp->fts_cur = p;
                                return (NULL);
                        }
                        fts_load(sp, p);
index 4cc5512..09198f3 100644 (file)
@@ -77,7 +77,7 @@ sha1_init_ctx (struct sha1_ctx *ctx)
    must be in little endian byte order.
 
    IMPORTANT: On some systems it is required that RESBUF is correctly
-   aligned for a 32 bits value.  */
+   aligned for a 32-bit value.  */
 void *
 sha1_read_ctx (const struct sha1_ctx *ctx, void *resbuf)
 {
@@ -94,7 +94,7 @@ sha1_read_ctx (const struct sha1_ctx *ctx, void *resbuf)
    prolog according to the standard and write the result to RESBUF.
 
    IMPORTANT: On some systems it is required that RESBUF is correctly
-   aligned for a 32 bits value.  */
+   aligned for a 32-bit value.  */
 void *
 sha1_finish_ctx (struct sha1_ctx *ctx, void *resbuf)
 {
index 3dbe1c9..aba416d 100644 (file)
@@ -1,3 +1,15 @@
+2006-01-10  Jim Meyering  <jim@meyering.net>
+
+       * fpending.m4: Also include <stdio.h>, for Dragonfly.
+       Patch by Joerg Sonnenberger.
+
+2006-01-10  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * memcoll.m4 (gl_MEMCOLL): Don't require AC_FUNC_MEMCMP, undoing
+       the 2002-12-31 change.  Problem and fix reported by Bruno Haible.
+       People who are still concerned with buggy memcmp implementations
+       can invoke gl_FUNC_MEMCMP themselves.
+
 2006-01-10  Simon Josefsson  <jas@extundo.com>
 
        * sys_socket_h.m4: New file.
index f43aaa4..edf7378 100644 (file)
@@ -1,6 +1,6 @@
-#serial 7
+#serial 8
 
-# Copyright (C) 2000, 2001, 2004, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2001, 2004, 2005, 2006 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -20,6 +20,7 @@ AC_DEFUN([gl_FUNC_FPENDING],
   AC_CHECK_HEADERS(stdio_ext.h)
   AC_REPLACE_FUNCS([__fpending])
   fp_headers='
+#     include <stdio.h>
 #     if HAVE_STDIO_EXT_H
 #      include <stdio_ext.h>
 #     endif
index 6f73412..2d153e5 100644 (file)
@@ -1,4 +1,4 @@
-# memcoll.m4 serial 5
+# memcoll.m4 serial 6
 dnl Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -10,6 +10,5 @@ AC_DEFUN([gl_MEMCOLL],
   AC_LIBOBJ([memcoll])
 
   dnl Prerequisites of lib/memcoll.c.
-  AC_REQUIRE([AC_FUNC_MEMCMP])
   AC_FUNC_STRCOLL
 ])