diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2006-01-10 21:31:01 +0000 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2006-01-10 21:31:01 +0000 |
commit | c43d62c6f29b412d3333808be3f1f619af19e3f4 (patch) | |
tree | 8f1f5f76e826fb34807059b3979d3a591810ecf1 /lib | |
parent | e48d8b47fb3eee81d341b71c3e006efe9e3433a7 (diff) | |
download | gnulib-c43d62c6f29b412d3333808be3f1f619af19e3f4.tar.gz |
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 <stdio.h>, for Dragonfly.
* m4/memcoll.m4 (gl_MEMCOLL): Don't require AC_FUNC_MEMCMP, undoing
the 2002-12-31 change.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ChangeLog | 13 | ||||
-rw-r--r-- | lib/fts.c | 1 | ||||
-rw-r--r-- | lib/sha1.c | 4 |
3 files changed, 16 insertions, 2 deletions
diff --git a/lib/ChangeLog b/lib/ChangeLog index 8626e27a8c..0b3394c5bd 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -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): @@ -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 4cc5512a4a..09198f3346 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) { |