From: Paul Eggert Date: Tue, 10 Jan 2006 21:31:01 +0000 (+0000) Subject: Sync from coreutils. X-Git-Tag: cvs-readonly~2646 X-Git-Url: https://erislabs.net/gitweb/?a=commitdiff_plain;h=c43d62c6f29b412d3333808be3f1f619af19e3f4;p=gnulib.git Sync from coreutils. 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 , for Dragonfly. * m4/memcoll.m4 (gl_MEMCOLL): Don't require AC_FUNC_MEMCMP, undoing the 2002-12-31 change. --- diff --git a/lib/ChangeLog b/lib/ChangeLog index 8626e27a8..0b3394c5b 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,16 @@ +2006-01-10 Jim Meyering + + 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 * regex_internal.h (BITSET_WORD_BITS): diff --git a/lib/fts.c b/lib/fts.c index ed09697e0..fb1a72a00 100644 --- 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); diff --git a/lib/sha1.c b/lib/sha1.c index 4cc5512a4..09198f334 100644 --- a/lib/sha1.c +++ b/lib/sha1.c @@ -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) { diff --git a/m4/ChangeLog b/m4/ChangeLog index 3dbe1c929..aba416d1c 100644 --- a/m4/ChangeLog +++ b/m4/ChangeLog @@ -1,3 +1,15 @@ +2006-01-10 Jim Meyering + + * fpending.m4: Also include , for Dragonfly. + Patch by Joerg Sonnenberger. + +2006-01-10 Paul Eggert + + * 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 * sys_socket_h.m4: New file. diff --git a/m4/fpending.m4 b/m4/fpending.m4 index f43aaa419..edf737800 100644 --- a/m4/fpending.m4 +++ b/m4/fpending.m4 @@ -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 # if HAVE_STDIO_EXT_H # include # endif diff --git a/m4/memcoll.m4 b/m4/memcoll.m4 index 6f7341287..2d153e5c2 100644 --- a/m4/memcoll.m4 +++ b/m4/memcoll.m4 @@ -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 ])