summaryrefslogtreecommitdiff
path: root/lib/openat.c
Commit message (Collapse)AuthorAgeFilesLines
* maint: run 'make update-copyright'Paul Eggert2020-12-311-1/+1
|
* openat: Make more robust in multithreaded applications.Bruno Haible2020-05-281-1/+1
| | | | * lib/openat.c (openat_needs_fchdir): Pass an O_CLOEXEC flag to open().
* open, openat: Really support O_CLOEXEC.Bruno Haible2020-05-241-1/+1
| | | | | | | | | | | * lib/open.c (open): When have_cloexec is still undecided, do pass a O_CLOEXEC flag to orig_open. * lib/openat.c (rpl_openat): When have_cloexec is still undecided, do pass a O_CLOEXEC flag to orig_openat. * tests/test-open.h (test_open): Verify that O_CLOEXEC is honoured. * modules/open-tests (Depends-on): Add fcntl. * modules/openat-tests (Depends-on): Likewise. * modules/fcntl-safer-tests (Depends-on): Likewise.
* Use module 'filename' instead of module 'dosname'.Bruno Haible2020-03-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/at-func.c: Include filename.h instead of dosname.h. * lib/unlinkat.c: Likewise. * modules/areadlinkat (Depends-on): Add filename. Remove dosname. * modules/areadlinkat-with-size (Depends-on): Likewise. * modules/faccessat (Depends-on): Likewise. * modules/fchmodat (Depends-on): Likewise. * modules/fchownat (Depends-on): Likewise. * modules/fstatat (Depends-on): Likewise. * modules/mkdirat (Depends-on): Likewise. * modules/mkfifoat (Depends-on): Likewise. * modules/readlinkat (Depends-on): Likewise. * modules/selinux-at (Depends-on): Likewise. * modules/symlinkat (Depends-on): Likewise. * modules/unlinkat (Depends-on): Likewise. * modules/utimensat (Depends-on): Likewise. * lib/at-func2.c: Include filename.h instead of dosname.h. * modules/linkat (Depends-on): Add filename. Remove dosname. * modules/renameatu (Depends-on): Likewise. * lib/canonicalize.c: Include filename.h instead of dosname.h. * lib/canonicalize-lgpl.c: Likewise. * modules/canonicalize (Depends-on): Add filename. * modules/canonicalize-lgpl (Depends-on): Likewise. * lib/dirname.h: Include filename.h instead of dosname.h. * modules/dirname-lgpl (Depends-on): Add filename. Remove dosname. * lib/fchdir.c: Include filename.h instead of dosname.h. * modules/fchdir (Depends-on): Add filename. Remove dosname. * lib/openat.c: Include filename.h instead of dosname.h. * modules/openat (Depends-on): Add filename. Remove dosname. * lib/rmdir.c: Include filename.h instead of dosname.h. * modules/rmdir (Depends-on): Add filename. Remove dosname. * lib/savewd.c: Include filename.h instead of dosname.h. * modules/savewd (Depends-on): Add filename. Remove dosname. * lib/unlink.c: Include filename.h instead of dosname.h. * modules/unlink (Depends-on): Add filename. Remove dosname. * modules/relocatable-prog-wrapper (Depends-on): Add filename. * lib/relocwrapper.c: Update comments. * modules/lstat (Depends-on): Remove dosname.
* open, openat: port to (O_RDWR | O_RDONLY) != 0Paul Eggert2020-03-071-1/+3
| | | | | | | | Potential portability problem reported by Dan Gohman in: https://lists.gnu.org/r/bug-gnulib/2020-03/msg00000.html * lib/open.c (open): * lib/openat.c (rpl_openat): Don’t assume O_RDONLY is disjoint from O_RDWR.
* openat: Fix theoretically possible issue on GNU/Hurd.Bruno Haible2020-03-071-1/+1
| | | | | | | | Reported by Dan Gohman <sunfish@mozilla.com> in <https://lists.gnu.org/archive/html/bug-gnulib/2020-03/msg00000.html>. * lib/openat.c (rpl_openat): When testing whether flags contains O_RDWR, ignore the bits that are also set in O_RDONLY.
* maint: Run 'make update-copyright'Paul Eggert2019-12-311-1/+1
|
* Update comments that refer to POSIX.Bruno Haible2019-09-281-1/+11
| | | | | | | * lib/creat.c, lib/fopen.c, lib/open.c, lib/openat.c: Cite the relevant sentence about trailing slashes. * lib/fflush.c: Clarify the reasoning. * tests/test-fflush2.c: Cite the relevant sentence.
* Update URLs and associated textPaul Eggert2019-09-231-2/+3
| | | | (Thanks to Bruno Haible for proofreading the earlier patch.)
* Update some URLsPaul Eggert2019-09-221-18/+2
| | | | | | This is a clerical change that mostly changes http: to https: in URLs where either will work. It also updates some URLs that have moved, removes some URLs that no longer work, and fixes related text.
* Include <stdlib.h> when needed.Bruno Haible2019-06-301-0/+1
| | | | | | | | | | | * lib/cnd.c: Include <stdlib.h>, needed for abort(). * lib/fcntl.c: Likewise. * lib/mbscasestr.c: Likewise. * lib/mbssep.c: Likewise. * lib/mbsstr.c: Likewise. * lib/openat.c: Include <stdlib.h>, needed for free(). * lib/windows-tls.c: Include <stdlib.h>, needed for malloc(), free(), abort().
* maint: Run 'make update-copyright'Paul Eggert2019-01-011-1/+1
|
* maint: Run 'make update-copyright'Paul Eggert2018-01-011-1/+1
|
* all: Replace many more http URLs by https URLs. Update stale URLs.Bruno Haible2017-09-141-1/+1
| | | | | * users.txt: Remove mention of 'newts'. * lib/localename.c: Update comment about LANG_SOTHO.
* all: prefer https: URLsPaul Eggert2017-09-131-1/+1
|
* open: support O_CLOEXECPaul Eggert2017-08-141-2/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * NEWS, doc/posix-functions/open.texi: * doc/posix-functions/openat.texi: Document this. * lib/fcntl.in.h (O_CLOEXEC): Default to a nonzero value. (GNULIB_defined_O_CLOEXEC): New symbol. * lib/open.c: Include cloexec.h. (open): Support O_CLOEXEC. * lib/openat.c: Include cloexec.h. (rpl_openat): Support O_CLOEXEC. * lib/popen-safer.c: Do not include cloexec.h. (open_noinherit): Remove. (popen_safer): Use O_CLOEXEC instead of set_cloexec_flag. * lib/save-cwd.c: Do not include cloexec.h. (save_cwd): Use O_CLOEXEC instead of set_cloexec_flag. * m4/open-cloexec.m4: New file. * m4/open.m4 (gl_FUNC_OPEN): Require gl_PREPROC_O_CLOEXEC. Replace 'open' if O_CLOEXEC is not present. * m4/openat.m4 (gl_FUNC_OPENAT): Require gl_PREPROC_O_CLOEXEC. Replace 'openat' if O_CLOEXEC is not present. * modules/freopen (Depends-on): Depend on 'open' if replacing freopen. * modules/open (Files): Add m4/open-cloexec.m4. (Depends-on): Depend on cloexec if replacing 'open'. * modules/openat (Files): Add m4/open-cloexec.m4. (Depends-on): Depend on cloexec if replacing openat. * modules/popen-safer (Depends-on): Remove cloexec. * modules/save-cwd (Depends-on): Remove cloexec, and add fd-safer-flag and 'open'.
* version-etc: new yearPaul Eggert2017-01-011-1/+1
| | | | | | | | | | * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
* version-etc: new yearPaul Eggert2016-01-011-1/+1
| | | | | | | | | | * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
* version-etc: new yearPaul Eggert2014-12-311-1/+1
| | | | | | * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright date. * all files: Run 'make update-copyright'.
* maint: update copyrightEric Blake2014-01-011-1/+1
| | | | | | I ran 'make update-copyright'. Signed-off-by: Eric Blake <eblake@redhat.com>
* maint: update all copyright year number rangesEric Blake2013-01-011-1/+1
| | | | | | Run "make update-copyright". Compare to commit 1602f0a from last year. Signed-off-by: Eric Blake <eblake@redhat.com>
* ftruncate, fts, lstat, openat, raise: no 'static inline'Paul Eggert2012-11-291-1/+1
| | | | | | | | | | | | | | | * lib/ftruncate.c (chsize_nothrow): * lib/fts.c (opendirat, diropen): * lib/lstat.c (orig_lstat): * lib/openat.c (orig_openat): * lib/raise.c (raise_nothrow): Now static, not static inline. * m4/ftruncate.m4 (gl_PREREQ_FTRUNCATE): * m4/fts.m4 (gl_FUNC_FTS_CORE): * m4/lstat.m4 (gl_PREREQ_LSTAT): * m4/openat.m4 (gl_PREREQ_OPENAT): * m4/raise.m4 (gl_PREREQ_RAISE): Do not require AC_C_INLINE.
* In commentary, do not use ` to quote.Paul Eggert2012-01-051-1/+1
|
* maint: update all copyright year number rangesJim Meyering2012-01-011-1/+1
| | | | Run "make update-copyright".
* openat: avoid compilation failure due to lack of <errno.h> inclusionDagobert Michelsen2011-11-181-0/+1
| | | | * lib/openat.c: Include <errno.h>.
* openat: Conditionalize dependencies.Bruno Haible2011-11-081-4/+4
| | | | | * lib/openat.c: Reduce the scope of some #includes. * modules/openat (Depends-on): Add conditions.
* openat: Include <stdbool.h>.Bruno Haible2011-11-051-0/+1
| | | | * lib/openat.c: Include <stdbool.h>.
* openat: Work around compilation error with OSF/1 5.1 DTK cc.Bruno Haible2011-09-081-0/+4
| | | | | | | | | | * lib/fopen.c: Use different syntax for include of <stdio.h>. * lib/freopen.c: Likewise. * lib/fstatat.c: Use different syntax for include of <sys/stat.h>. * lib/lstat.c: Likewise. * lib/stat.c: Likewise. * lib/open.c: Use different syntax for include of <fcntl.h>. * lib/openat.c: Include fcntl.h again, explicitly.
* openat: port to AIX 7.1 with large filesPaul Eggert2011-09-051-3/+18
| | | | | | | | | | | | | AIX 7.1 does a "#define openat open64at" if large files are in use, so we can't simply #undef openat. Use the orig_openat trick (similar to orig_open in lib/open.c) to work around the problem. Problem reported by Kevin Brott for GNU tar, in the thread containing <http://lists.gnu.org/archive/html/bug-tar/2011-09/msg00032.html>. * lib/openat.c (__need_system_fcntl_h): Define first. Include <fcntl.h> and <sys/types.h> before undefining. (orig_openat) [HAVE_OPENAT]: New inline function. (openat) [HAVE_OPENAT]: Do not undef. (rpl_openat): Use orig_openat, not openat.
* dirname: move m4/dos.m4 functionality into lib/dosname.hPaul Eggert2011-02-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | m4/dos.m4 needs to go. It laboriously invokes the C compiler, and extracts symbols from it, puts them into config.h; but it's much easier to use the symbols directly. filename.h already does this, but it disagrees with dos.m4 in some respects. This patch introduces a different include file dosname.h that packages up dos.m4, and then later we can work on merging filename.h and dosname.h. Applications that need only the easy-to-configure symbols should consider including dosname.h rather than dirname.h. * NEWS: Mention incompatible changes. * m4/dos.m4: Remove. * lib/dosname.h, modules/dosname: New files. * lib/dirname.h (ISSLASH, FILE_SYSTEM_PREFIX_LEN): (FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE): (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): Move to lib/dosname.h. * lib/at-func.c, lib/at-func2.c, lib/openat.c, lib/savewd.c: Include dosname.h, not dirname.h. * lib/rmdir.c, lib/stat.c, lib/unlink.c, lib/unlinkat.c: Include dosname.h, for definitions of symbols like ISSLASH that used to be in config.h. * m4/dirname.m4 (gl_DIRNAME_LGPL): Do not require gl_AC_DOS. * m4/rmdir.m4 (gl_FUNC_RMDIR): Likewise. * m4/stat.m4 (gl_FUNC_STAT): Likewise. * m4/unlink.m4 (gl_FUNC_UNLINK): Likewise. * modules/dirname-lgpl (Files): Omit m4/dos.m4. * modules/rmdir (Files): Likewise. * modules/stat (Files): Likewise. * modules/unlink (Files): Likewise. * modules/dirname-lgpl (Depends-on): Add dosname. * modules/lstat (Depends-on): Likewise. * modules/openat (Depends-on): Likewise. * modules/rmdir (Depends-on): Likewise. * modules/savewd (Depends-on): Likewise. * modules/stat (Depends-on): Likewise. * modules/unlink (Depends-on): Likewise. * modules/openat (Depends-on): Remove dirname-lgpl. * modules/savewd (Depends-on): Likewise. * tests/test-dirname.c: Do not use removed symbols like FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR. Instead, use the remaining symbols, e.g., ISSLASH ('\\').
* maint: adjust cpp indentation to reflect nesting depthJim Meyering2011-02-221-4/+4
| | | | | | | | | | | | | | | | | | | | | | I.e., in a block of code that begins with an unnested "#if", put one space between the "#" in column 1 and following token. For example, -#include <sys/vfs.h> +# include <sys/vfs.h> Do this only in .c files that are part of a module I maintain. * lib/linkat.c: Filter through cppi. * lib/nanosleep.c: Likewise. * lib/openat.c: Likewise. * lib/openat-die.c: Likewise. * lib/dup3.c: Likewise. * lib/fchownat.c: Likewise. * lib/flock.c: Likewise. * lib/fsync.c: Likewise. * lib/fts.c: Likewise. * lib/getpass.c: Likewise. * lib/gettimeofday.c: Likewise. * lib/userspec.c: Likewise. * Makefile (sc_cpp_indent_check): New rule, to check this.
* maint: update almost all copyright ranges to include 2011Jim Meyering2011-01-011-1/+1
| | | | Run the new "make update-copyright" rule.
* fcntl-h, etc.: prefer O_SEARCH to O_RDONLY when applicablePaul Eggert2010-09-011-1/+1
| | | | | | | | | | | | | | | | | | | | POSIX 2008 specifies a new 'open' flag O_SEARCH, which can be used when one needs search access to a directory but not read access. On systems where it is available, it works in some cases where O_RDONLY does not, namely on directories that are searchable but not readable, and which need only to be searchable. If O_SEARCH is not available, fall back to the traditional method of using O_RDONLY. * lib/fcntl.in.h (O_SEARCH): #define to O_RDONLY if not defined. * lib/chdir-long.c (cdb_advance_fd): Use O_SEARCH, not O_RDONLY, when opening a directory that needs only to be searchable. * lib/chdir-safer.c (chdir_no_follow): Likewise. * lib/fts.c (diropen, fts_open, fd_ring_check): Likewise. * lib/openat-proc.c (openat_proc_name): Likewise. * lib/openat.c (openat_needs_fchdir): Likewise. * lib/save-cwd.c (save_cwd): Likewise. * lib/savewd.c (savewd_save, savewd_chdir): Likewise.
* update nearly all FSF copyright year lists to include 2010Jim Meyering2010-01-011-1/+1
| | | | | Use the same procedure as for 2009, outlined in http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/20081
* openat, utimens: whitespace cleanupEric Blake2009-10-071-46/+46
| | | | | | | | | * lib/openat.c: Prefer space throughout, rather than mix of 8 spaces vs. tabs. * lib/at-func.c: Likewise. * lib/utimens.c: Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
* openat: avoid using wrong fdEric Blake2009-10-071-0/+9
| | | | | | | | | | | | | | Detected by a Solaris failure on: int fd = dup (0); close (fd); mkdirat (fd, "dir", 0700); which created "./dir" instead of failing with EBADF. * lib/openat.c (openat_permissive): Reject user's fd if saving the working directory chooses same fd. * lib/at-func.c (AT_FUNC_NAME): Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
* open, openat: minor optimizationEric Blake2009-09-221-1/+2
| | | | | | | * lib/open.c (open): If open succeeded, len is non-zero. * lib/openat.c (rpl_openat): Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
* openat: fix openat bugs on Solaris 9Eric Blake2009-09-191-0/+97
| | | | | | | | | | | | | | openat(fd,"file/",O_RDONLY) mistakenly succeeded. * lib/openat.c (rpl_openat): Work around Solaris 9 bug. * m4/openat.m4 (gl_FUNC_OPENAT): Also replace openat on Solaris. * modules/openat (Depends-on): Add open. * m4/fcntl_h.m4 (gl_FCNTL_H_DEFAULTS): Provide new default. * modules/fcntl-h (Makefile.am): Substitute it. * lib/fcntl.in.h (openat): Declare replacement. * doc/posix-functions/openat.texi (openat): Document this. Signed-off-by: Eric Blake <ebb9@byu.net>
* openat: move fstatat and unlinkat into correct filesEric Blake2009-09-191-62/+0
| | | | | | | | | | | | Code motion, should be no semantic changes. * m4/openat.m4 (gl_FUNC_OPENAT): Adjust which files will be compiled. * lib/openat.c (fstatat, unlinkat): Move... * lib/fstatat.c (fstatat): ...into correct files. * lib/unlinkat.c (unlinkat): Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
* stat: new module, for mingw bugEric Blake2009-09-191-1/+19
| | | | | | | | | | | | | | | | | | | | | Depending on the current directory, either stat(".",buf) or stat("./",buf) would fail on mingw. * 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. Signed-off-by: Eric Blake <ebb9@byu.net>
* openat: allow return of fd 0Eric Blake2009-09-191-8/+7
| | | | | | | | | | | | | | | | | | | | | | | Partially reverts patch fc33350 from 2009-09-02. * 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. Signed-off-by: Eric Blake <ebb9@byu.net>
* openat: make template easier to useEric Blake2009-09-031-2/+2
| | | | | | | | | | | | | | | | | * lib/at-func.c (CALL_FUNC): Allow AT_FUNC_USE_F1_COND and AT_FUNC_F2 to be undefined. (VALIDATE_FLAG): New macro; use it to reject bad flags. (AT_FUNC_USE_F1_COND): Change sense to just flag bit. * lib/fchmodat.c (AT_FUNC_USE_F1_COND): Adjust. * lib/fchownat.c (AT_FUNC_USE_F1_COND): Likewise. * lib/openat.c (AT_FUNC_USE_F1_COND) [fstatat, unlinkat]: Likewise. * lib/mkdirat.c (AT_FUNC_F2, AT_FUNC_USE_F1_COND): Delete. * lib/selinux-at.c (AT_FUNC_F2, AT_FUNC_USE_F1_COND) [getfileconat, lgetfileconat, setfileconat, lsetfileconat]: Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
* openat-safer: new moduleEric Blake2009-09-021-1/+7
| | | | | | | | | | | | | | | | * modules/openat-safer: New file. * lib/openat-safer.c: Likewise. * m4/fcntl-safer.m4 (gl_OPENAT_SAFER): New macro. * lib/fcntl-safer.h (openat_safer): Declare. * lib/fcntl--.h (openat): Override. * MODULES.html.sh (File descriptor based I/O): Mention it. * lib/openat.h: Add double-inclusion guards. * lib/openat.c (includes): Only include "fcntl-safer.h", not "fcntl--.h", so we can implement openat. * modules/openat-safer-tests: New test. * tests/test-openat-safer.c: New file. Signed-off-by: Eric Blake <ebb9@byu.net>
* fdopendir: split into its own moduleEric Blake2009-09-021-68/+0
| | | | | | | | | | | | | | | | | | | | | | | * lib/openat.c (fdopendir): Move... * lib/fdopendir.c: ...into new file. * modules/fdopendir: New module. * m4/fdopendir.m4 (gl_FUNC_FDOPENDIR): New file. * modules/openat (Depends-on): Add fdopendir. * m4/openat.m4 (gl_FUNC_OPENAT): No longer need to check for fdopendir here. * modules/savedir (Depends-on): Only need fdopendir, not full openat. * lib/savedir.c (include): Use <dirent.h>, not "openat.h". * lib/openat.h (fdopendir): Drop prototype. * lib/dirent.in.h (fdopendir): Provide prototype. * m4/dirent_h.m4 (gl_DIRENT_H_DEFAULTS): Add replacements. * modules/dirent (Makefile.am): Substitute them. * MODULES.html.sh (File system functions): Mention it. * doc/posix-functions/fdopendir.texi (fdopendir): Likewise. * modules/fdopendir-tests: New file. * tests/test-fdopendir.c: Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
* Simplify use of mode_t varargs.Bruno Haible2009-05-221-7/+4
|
* Move the lstat() declaration to <sys/stat.h>.Bruno Haible2008-10-211-2/+2
|
* Change copyright notice from GPLv2+ to GPLv3+.Bruno Haible2007-10-071-5/+4
|
* Revamp lchown so that it lives in unistd.h where it belongs.Paul Eggert2007-06-161-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | * lib/lchown.h: Remove. * lib/dirchownmod.c: Don't include lib/lchown.h. * lib/fchownat.c: Likewise. * lib/openat.c: Likewise. * lib/lchown.c (REPLACE_CHOWN): Define to 0 if the system chown does not follow symlinks. (EOPNOTSUPP): Define if not defined. * lib/unistd_.h (chown): Do not replace if REPLADE_CHOWN is defined to 0. (lchown): New decl. * m4/lchown.m4 (gl_FUNC_LCHOWN): Require gl_UNISTD_H_DEFAULTS. Do not check for lchown decl. Set REPLACE_LCHOWN. * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Set GNULIB_LCHOWN, REPLACE_LCHOWN. * modules/chown: Make it clear it follows symlinks. * modules/lchown: Make it clear it doesn't follow symlinks. (Files): Remove lib/lchown.h (Depends-on): Add unistd. (configure.ac): Add gl_UNISTD_MODULE_INDICATOR([lchown]). (Include): Include <unistd.h>, not "lchown.h". * modules/unistd (unistd.h): Substitude GNULIB_LCHOWN and REPLACE_LCHOWN.
* Work around an fchownat bug in glibc-2.4:Jim Meyering2006-12-241-16/+0
| | | | | | | | | | | | http://lists.ubuntu.com/archives/ubuntu-users/2006-September/093218.html This bug would cause "chown -RP ... DIR" to follow symlinks in DIR, in spite of the -P option. * m4/openat.m4 (gl_FUNC_FCHOWNAT, gl_FUNC_FCHOWNAT_DEREF_BUG): New macros. (gl_PREREQ_OPENAT): Require gl_FUNC_FCHOWNAT. * modules/openat (Files): Add lib/fchownat.c. * lib/openat.c (fchownat): Don't define here. Move to... * lib/fchownat.c: ...this new file.
* [lib/ChangeLog]Paul Eggert2006-10-051-0/+1
| | | | | | | | | | | | | | | | Fix some Darwin-7.9.0 porting problems reported by Bruno Haible in <http://lists.gnu.org/archive/html/bug-coreutils/2006-10/msg00063.html>. * dirchownmod.c: Include lchown.h. * lchown.c: Don't include files that lchown.h now includes. Don't declare chown, since lchown.h now does that. * lchown.h: Include errno.h, sys/types.h, unistd.h. (lchown): Define to rpl_chown if lchown is declared but does not exist. Declare using a prototype if lchown is not declared. Add a copyright notice. * mkstemp.h: Include <unistd.h>. * openat.c: Include lchown.h. [m4/ChangeLog] * lchown.m4 (gl_FUNC_LCHOWN): Check whether lchown is declared.