summaryrefslogtreecommitdiff
path: root/lib/fchownat.c
Commit message (Collapse)AuthorAgeFilesLines
* maint: run 'make update-copyright'Simon Josefsson2023-01-011-1/+1
|
* statat: now obsoletePaul Eggert2022-03-091-1/+1
| | | | | | | | | * lib/openat.h (statat, lstatat): Now deprecated. All uses removed, and replaced with fstatat. * modules/statat: Mark as obsolete, because it’s confusing: it’s not clear whether it should use AT_NO_AUTOMOUNT, which is implied by stat and by lstat, but not by fstatat. * tests/test-statat.c: Disable deprecated-declarations warnings.
* license: fix GPLv3 texts to use a comma instead of semicolon.Bernhard Voelker2022-01-051-1/+1
| | | | | | | | | See: https://www.gnu.org/licenses/gpl-3.0.html#howto Run: $ git grep -l 'Foundation; either version 3' \ | xargs sed -i '/Foundation; either version 3/ s/n; e/n, e/' * All files using GPLv3: Adjust via the above command.
* maint: run 'make update-copyright'Paul Eggert2022-01-011-1/+1
|
* maint: run 'make update-copyright'Paul Eggert2020-12-311-1/+1
|
* maint: Run 'make update-copyright'Paul Eggert2019-12-311-1/+1
|
* Include <stdlib.h> when needed.Bruno Haible2019-06-301-0/+2
| | | | | | | | | | | | | | * lib/areadlinkat.c: Include <stdlib.h>, needed for free() in at-func.c. * lib/faccessat.c: Likewise. * lib/fchmodat.c: Likewise. * lib/fchownat.c: Likewise. * lib/fstatat.c: Likewise. * lib/mkfifoat.c: Likewise. * lib/mknodat.c: Likewise. * lib/readlinkat.c: Likewise. * lib/symlinkat.c: Likewise. * lib/utimensat.c: Likewise. * lib/mkdirat.c: Likewise. Include also the specification header.
* 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
|
* 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>
* fchmodat, fchownat, fstatat: port to non-inlining compilersPaul Eggert2012-10-151-2/+0
| | | | | | | | | | | | | | Problem reported for FreeBSD 9 by Jim Meyering in <http://lists.gnu.org/archive/html/bug-gnulib/2012-10/msg00070.html>. * lib/chmodat.c, lib/chownat.c, lib/statat.c: New files, which define FCHMODAT_INLINE etc. * lib/fchmodat.c (FCHMODAT_INLINE): * lib/fchownat.c (FCHOWNAT_INLINE): * lib/fstatat.c (FSTATAT_INLINE): Remove, as chmodat.c etc. now do this. * modules/fchmodat (Files): Add lib/chmodat.c. * modules/fchownat (Files): Add lib/chownat.c. * modules/fstatat (Files): Add lib/statat.c.
* fchmodat.c, fchownat.c: fix compile-impeding typosJim Meyering2012-10-151-1/+1
| | | | | | * lib/fchmodat.c (FCHMODAT_INLINE): Fix typo: s/#include/#define/ * lib/fchownat.c (FCHOWNAT_INLINE): Likewise. Introduced in commit v0.0-7636-gd202279.
* fchmodat, fchownat, fstatat: use extern-inlinePaul Eggert2012-09-221-0/+2
| | | | | | | | | | | | | | | * lib/fchmodat.c, lib/openat.h (FCHMODAT_INLINE): * lib/fchownat.c, lib/openat.h (FCHOWNAT_INLINE): * lib/fstatat.c, lib/openat.h (FSTATAT_INLINE): New macros. * lib/openat.h: Replace all uses of 'static inline' with them. Use _GL_INLINE_HEADER_BEGIN, _GL_INLINE_HEADER_END. * modules/fchmodat, modules/fchownat, modules/fstatat: * modules/openat-h: (Depends-on): Add extern-inline. (configure.ac): Remove AC_C_INLINE.
* maint: update all copyright year number rangesJim Meyering2012-01-011-1/+1
| | | | Run "make update-copyright".
* maint: adjust cpp indentation to reflect nesting depthJim Meyering2011-02-221-9/+9
| | | | | | | | | | | | | | | | | | | | | | 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.
* openat: Work around glibc bug with fchownat() and empty file names.Bruno Haible2010-11-131-0/+7
| | | | | | | | * m4/openat.m4 (gl_FUNC_FCHOWNAT_EMPTY_FILENAME_BUG): New macro. (gl_FUNC_FCHOWNAT): Invoke it. * lib/fchownat.c (rpl_fchownat): Handle the empty file name specially. * doc/posix-functions/fchownat.texi: Document the glibc bug. Reported by Gary V. Vaughan <gary@gnu.org>.
* 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: detect Solaris fchownat bugEric Blake2009-11-141-7/+72
| | | | | | | | | | | | | | | | | | Solaris 9 fchownat(dir,"name/",uid,gid,flag) has same bugs as chown and lchown. * lib/fchownat.c (rpl_fchownat): Work around Solaris bug. Avoid penalizing glibc chownat when only lchownat is broken. * m4/openat.m4 (gl_FUNC_FCHOWNAT): Replace fchownat if there are trailing slash bugs. * doc/posix-functions/fchownat.texi (fchownat): Document the bug. * modules/openat-tests (Files): Include more files. (Depends-on): Add mgetgroups, sleep, stat-time. (configure.ac): Add additional checks. (Makefile.am): Build new test. * tests/test-fchownat.c: New file. Signed-off-by: Eric Blake <ebb9@byu.net>
* openat: simplify use of at-func.cEric Blake2009-09-191-5/+0
| | | | | | | | | | | | | | * 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. Signed-off-by: Eric Blake <ebb9@byu.net>
* doc: fix comments in recent patchesEric Blake2009-09-061-2/+2
| | | | | | | | | | | * lib/faccessat.c: Mention correct function. * lib/fchmodat.c: Likewise. * lib/fchownat.c: Likewise. * lib/symlinkat.c: Likewise. * doc/posix-headers/fcntl.texi (fcntl.h): Cygwin 1.7 has AT_* constants. Signed-off-by: Eric Blake <ebb9@byu.net>
* openat: make template easier to useEric Blake2009-09-031-1/+1
| | | | | | | | | | | | | | | | | * 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: declare in POSIX headersEric Blake2009-09-031-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * NEWS: Mention this. * modules/openat (configure.ac): Declare witnesses. (Depends-on): Add fcntl-h, sys_stat, unistd. (Include): Mention correct headers. * modules/fcntl-h (Depends-on): Add link-warning. (Files): Add openat.m4. (Makefile.am): Substitute witnesses. * modules/sys_stat (Files, Makefile.am): Likewise. * modules/unistd (Files, Makefile.am): Likewise. * m4/openat.m4 (gl_FUNC_OPENAT, gl_FUNC_FCHOWNAT): Set witnesses. (gl_OPENAT_DEFAULTS): New macro. * m4/fcntl_h.m4 (gl_FCNTL_H_DEFAULTS): Use it. * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Likewise. * m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS): Likewise. (SYS_STAT_H): Remove unused variable. * doc/posix-headers/fcntl.texi (fcntl.h): Update content. * lib/fcntl--.h (includes): Remove unneeded header. * lib/openat-safer.c (includes): Likewise. * lib/openat.h (AT_FDCWD, AT_SYMLINK_NOFOLLOW, AT_REMOVEDIR) (openat, fstatat, unlinkat, mkdirat, fchmodat, fchownat): Move to appropriate headers. (__OPENAT_PREFIX): Delete. * lib/fcntl.in.h (openat): Provide declaration. (AT_FDCWD): Fix Solaris bug. (AT_SYMLINK_NOFOLLOW, AT_REMOVEDIR): Provide macros. * lib/sys_stat.in.h (fstatat, mkdirat): Provide declaration. * lib/fchmodat.c (includes): Adjust to find declaration. * lib/fchownat.c (includes): Likewise. * lib/mkdirat.c (includes): Likewise. * lib/fstatat.c (includes): Likewise. Ensure original fstatat is still visible. Signed-off-by: Eric Blake <ebb9@byu.net>
* 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-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* * lib/fchownat.c: Include lchown.h.Jim Meyering2007-03-181-1/+2
| | | | 2007-03-17 Bruno Haible <bruno@clisp.org>
* Work around an fchownat bug in glibc-2.4:Jim Meyering2006-12-241-0/+49
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.