openat: fix fstatat bugs on Solaris 9
[gnulib.git] / ChangeLog
index d02e891..e79f9dd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,179 @@
+2009-09-19  Eric Blake  <ebb9@byu.net>
+
+       openat: fix fstatat bugs on Solaris 9
+       * lib/fstatat.c (rpl_fstatat): Copy recent fixes from lstat and
+       stat.
+       * doc/posix-functions/fstatat.texi (fstatat): Document this.
+
+       test-unlinkat: enhance test, to expose Solaris 9 bug
+       * tests/test-unlink.c (main): Factor guts...
+       * tests/test-unlink.h (test_rmdir_func): ...into new file.
+       * tests/test-rmdir.h (test_rmdir_func): Add parameter.
+       * tests/test-rmdir.c (main): Adjust caller.
+       * tests/test-unlinkat.c (main): Likewise.  Add unlink tests.
+       (unlinker): New helper function.
+       (rmdirat): Enhance check.
+       * modules/rmdir-tests (Depends-on): Add stdbool.
+       * modules/unlink-tests (Depends-on): Likewise.
+       (Files): Add test-unlink.h.
+       * modules/openat-tests (Files): Likewise.
+       (Depends-on): Add unlinkdir.
+
+       test-fstatat: new test, to expose Solaris 9 bugs
+       * tests/test-stat.c (main): Factor guts...
+       * tests/test-stat.h (test_stat_func): ...into new file.
+       * tests/test-lstat.c (main): Factor guts...
+       * tests/test-lstat.h (test_lstat_func): ...into new file.
+       * tests/test-fstatat.c: New file.
+       * modules/stat-tests (Files): Add test-stat.h.
+       * modules/lstat-tests (Files): Add test-lstat.h.
+       (Depends-on): Add stdbool.
+       * modules/openat-tests (Depends-on): Add pathmax.
+       (Files): Add test-lstat.h, test-stat.h, test-fstatat.c.
+       (Makefile.am): Run new test.
+
+       remove: new module, for mingw and Solaris 9 bugs
+       * modules/remove: New file.
+       * lib/remove.c: Likewise.
+       * m4/remove.m4 (gl_FUNC_REMOVE): Likewise.
+       * m4/stdio_h.m4 (gl_STDIO_H_DEFAULTS): Add witnesses.
+       * modules/stdio (Makefile.am): Use them.
+       * lib/stdio.in.h (remove): Declare replacement.
+       * MODULES.html.sh (systems lacking POSIX:2008): Mention module.
+       * doc/posix-functions/remove.texi (remove): Likewise.
+       * modules/remove-tests: New test.
+       * tests/test-remove.c: Likewise.
+
+       unlink: new module, for Solaris 9 bug
+       * modules/unlink: New file.
+       * lib/unlink.c: Likewise.
+       * m4/unlink.m4 (gl_FUNC_UNLINK): Likewise.
+       * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Add witnesses.
+       * modules/unistd (Makefile.am): Use them.
+       * lib/unistd.in.h (stat): Declare replacement.
+       * MODULES.html.sh (systems lacking POSIX:2008): Mention module.
+       * doc/posix-functions/unlink.texi (unlink): Likewise.
+       * modules/unlink-tests: New test.
+       * tests/test-unlink.c: Likewise.
+
+       lstat: fix Solaris 9 bug
+       * lib/lstat.c (lstat): Also check for trailing slash on
+       non-symlink, non-directories.  Use stat module to simplify logic.
+       * doc/posix-functions/lstat.texi (lstat): Document it.
+       * modules/lstat-tests (Depends-on): Add errno, same-inode.
+       (configure.ac): Check for symlink.
+       * tests/test-lstat.c (main): Add more tests.
+
+       stat: add as dependency to other modules
+       * modules/chown (Depends-on): Add stat.
+       * modules/euidaccess (Depends-on): Likewise.
+       * modules/fchdir (Depends-on): Likewise.
+       * modules/isdir (Depends-on): Likewise.
+       * modules/link (Depends-on): Likewise.
+       * modules/lstat (Depends-on): Likewise.
+       * modules/mkdir-p (Depends-on): Likewise.
+       * modules/modechange (Depends-on): Likewise.
+       * modules/open (Depends-on): Likewise.
+       * modules/readlink (Depends-on): Likewise.
+       * modules/same (Depends-on): Likewise.
+
+       stat: fix Solaris 9 bug
+       * m4/stat.m4 (gl_FUNC_STAT): Detect Solaris 9 bug with trailing
+       slash.
+       * lib/stat.c (rpl_stat): Work around it.
+       * doc/posix-functions/stat.texi (stat): Update documentation.
+
+       stat: new module, for mingw bug
+       * modules/stat: New file.
+       * lib/stat.c: Likewise.
+       * m4/stat.m4 (gl_FUNC_STAT): Likewise.
+       * m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS): Add witnesses.
+       * modules/sys_stat (Makefile.am): Use them.
+       * lib/sys_stat.in.h (stat): Declare replacement.
+       * lib/openat.c (fstatat): Deal with lstat and stat being function
+       macros.
+       * modules/openat (Depends-on): Add inline.
+       * MODULES.html.sh (systems lacking POSIX:2008): Mention module.
+       * doc/posix-functions/stat.texi (stat): Likewise.
+       * modules/stat-tests: New test.
+       * tests/test-stat.c: Likewise.
+
+2009-09-19  Jim Meyering  <meyering@redhat.com>
+
+       syntax-check: detect unnecessary inclusion of canonicalize.h
+       * top/maint.mk (sc_prohibit_canonicalize_without_use): New rule.
+
+2009-09-19  Eric Blake  <ebb9@byu.net>
+
+       canonicalize-lgpl: adjust clients to use correct header
+       * m4/canonicalize.m4 (gl_FUNC_CANONICALIZE_FILENAME_MODE)
+       (gl_CANONICALIZE_LGPL): Use correct shell quoting.
+       * modules/relocatable-prog-wrapper (Files): Drop canonicalize.h.
+       * lib/fchdir.c (includes): Use <stdlib.h>, not "canonicalize.h".
+       * lib/progreloc.c (includes): Likewise.
+
+2009-09-19  Jim Meyering  <meyering@redhat.com>
+
+       test-posixtm.c: correct a comment
+       * tests/test-posixtm.c: Correct first-line comment.
+       Spotted by Eric Blake.
+
+2009-09-16  Jim Meyering  <meyering@redhat.com>
+
+       posixtm-tests: make T const-correct; add a test case
+       * tests/test-posixtm.c (T): Declare const.
+       Add a test for -(2^31+1).
+       Remove useless can-succeed-only-in-2002 test.
+
+       posixtm-tests: adjust the sole failing test
+       * tests/test-posixtm.c: Correct 0000-01-01 00:00:00 test so that
+       expected output matches what mktime now produces.  Cross-checked via
+       erlang's calendar:datetime_to_gregorian_seconds({{1970,1,1},{0,0,0}})
+
+       posixtm: move #ifdef'd tests into a new module
+       * lib/posixtm.c (posixtime): Remove #ifdef'd tests.  Move to...
+       * tests/test-posixtm.c: ... this new file.
+       * modules/posixtm-tests: New module.
+
+2009-09-19  Eric Blake  <ebb9@byu.net>
+
+       openat: simplify use of at-func.c
+       * lib/at-func.c (includes): Include prerequisites here, to
+       simplify requirements on client files.
+       * lib/openat-priv.h: Add double-inclusion guard.
+       * lib/faccessat.c (includes): Simplify.
+       * lib/fchmodat.c (includes): Likewise.
+       * lib/fchownat.c (includes): Likewise.
+       * lib/mkdirat.c (includes): Likewise.
+       * lib/mkfifoat.c (includes): Likewise.
+       * lib/symlinkat.c (includes): Likewise.
+
+       openat: allow return of fd 0
+       * modules/chdir-long (Depends-on): Relax openat-safer to openat.
+       * modules/save-cwd (Depends-on): Replace fcntl-safer with
+       unistd-safer.
+       * lib/chdir-long.c (includes): Replace "fcntl--.h" with
+       <fcntl.h>; this module does not leak fds.
+       * lib/openat.c (includes): Do not use "fcntl_safer"; plain openat
+       must be allowed to return 0, leaving openat_safer to add the
+       safety.
+       (openat_permissive): Avoid writing to just-opened fd 2 if
+       restoring the current directory fails.
+       * lib/openat-die.c (openat_restore_fail): Add comment.
+       * lib/save-cwd.c (includes): Make "fcntl--.h" conditional.
+       (save_cwd): Guarantee safe fd, but without use of open_safer.
+       * tests/test-openat.c: New test.
+       * modules/openat-tests (Files, Makefile.am): Distribute and build
+       new file.
+
+       relocatable-prog-wrapper: fix build
+       * modules/relocatable-prog-wrapper (Files): Update name of
+       canonicalize m4 file, broken on 2009-09-17.
+       Reported by emad hajjar <aleppos@hotmail.com>.
+
 2009-09-19  Bruno Haible  <bruno@clisp.org>
 
-       * lib/safe-alloc.h: Use the standard header with LGPL copyright.
+       * lib/safe-alloc.h: Use the standard header with GPL copyright.
        * lib/safe-alloc.c: Likewise.
        Reported by Ian Beckwith <ianb@erislabs.net>.