summaryrefslogtreecommitdiff
path: root/tests/test-lchown.h
Commit message (Collapse)AuthorAgeFilesLines
* chown, lchown tests: Fix link error on mingw 10.Bruno Haible2023-04-201-0/+4
| | | | | | | | * modules/chown-tests (configure.ac): Test whether getgid() exists. * modules/lchown-tests (configure.ac): Likewise. * modules/fchownat-tests (configure.ac): Likewise. * tests/test-chown.h (getgid): Define a fallback. * tests/test-lchown.h (getgid): Likewise.
* chown, lchown, fchownat tests: Avoid test failure on macOS 12.Bruno Haible2023-02-101-4/+10
| | | | | | * tests/test-chown.h (test_chown): Skip some assertions if getgid() == (gid_t)-1. * tests/test-lchown.h (test_lchown): Likewise.
* maint: run 'make update-copyright'Simon Josefsson2023-01-011-1/+1
|
* 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
|
* maint: Run 'make update-copyright'Paul Eggert2019-01-011-1/+1
|
* lchown tests: Be more permissive regarding errno values.Bruno Haible2018-12-201-1/+1
| | | | | | | | | Reported by Ivan Zakharyaschev <imz@altlinux.org>. * tests/test-lchown.h (test_lchown): Recognize EOPNOTSUPP as an alternative to ENOSYS. * modules/lchown-tests (Depends-on): Add 'errno'. * modules/fchownat-tests (Depends-on): Likewise.
* maint: Run 'make update-copyright'Paul Eggert2018-01-011-1/+1
|
* 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>
* test-lchown, test-chown: also skip test if lchown/chown fails with EPERMBernhard Voelker2013-05-221-2/+2
| | | | | | | | | | These tests abort on FAT file systems right after the test for filtering out situation without ownership support; errno is EPERM in such a case. * tests/test-lchown.h (test_lchown): Add EPERM to the condition to skip this test. * tests/test-chown.h (test_chown): Likewise.
* 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>
* maint: update all copyright year number rangesJim Meyering2012-01-011-1/+1
| | | | Run "make update-copyright".
* maint: change "a a" to "a"Jim Meyering2011-04-091-1/+1
| | | | * tests/test-lchown.h (test_lchown): s/a a/a/
* maint: update almost all copyright ranges to include 2011Jim Meyering2011-01-011-1/+1
| | | | Run the new "make update-copyright" rule.
* 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
* test-utimens: avoid spurious failureEric Blake2009-12-211-45/+1
| | | | | | | | | | | | | | | | | | | | Fixes a spurious failure on ext3, with one-second resolution, now that ctime effects are being tested for inequality. * tests/test-chown.h (nap): Factor... * tests/nap.h: ...into new file. * tests/test-lchown.h (nap): Avoid duplication. * tests/test-utimens-common.h (nap): Use shared implementation, necessary on file systems with 1-second resolution. * modules/chown-tests (Files): Include new file. * modules/fdutimensat-tests (Files): Likewise. * modules/futimens-tests (Files): Likewise. * modules/lchown-tests (Files): Likewise. * modules/openat-tests (Files): Likewise. * modules/utimens-tests (Files): Likewise. * modules/utimensat-tests (Files): Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
* mgetgroups: reduce duplicate listingsEric Blake2009-12-071-21/+12
| | | | | | | | | | | | | | | | POSIX doesn't guarantee whether the effective gid is included in the list of supplementary groups returned by getgroups. On the other hand, some platforms include the effective gid twice in the list. Meanwhile, mgetgroups can independently add a duplicate. Rather than spend a full-blown O(n log n) cleanup, we just remove the most common forms of duplicate groups with an O(n) pass. * lib/mgetgroups.c (mgetgroups): Reduce duplicates from the resulting array. * tests/test-chown.h (test_chown): Simplify client. * tests/test-lchown.h (test_lchown): Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
* mgetgroups: avoid argument promotion issues with -1Eric Blake2009-12-041-4/+5
| | | | | | | | | | | | On platforms where gid_t is equivalent to uint16_t, argument promotion states that -1 != (gid_t) -1. * lib/mgetgroups.c (mgetgroups): A cast is required when checking for invalid gid_t. * tests/test-chown.h (getegid, test_chown): Likewise. * tests/test-lchown.h (getegid, test_lchown): Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
* usleep: use it to simplify testsEric Blake2009-11-171-13/+4
| | | | | | | | | | | | | | | | | | | | | | | Blindly using usleep makes it easier to write tests. * modules/stat-time-tests (Depends-on): Add usleep. (configure.ac): Drop usleep check. * modules/chown-tests (Depends-on, configure.ac): Likewise. * modules/lchown-tests (Depends-on, configure.ac): Likewise. * modules/fdutimensat-tests (Depends-on, configure.ac): Likewise. * modules/futimens-tests (Depends-on, configure.ac): Likewise. * modules/openat-tests (Depends-on, configure.ac): Likewise. * modules/utimens-tests (Depends-on, configure.ac): Likewise. * modules/utimensat-tests (Depends-on, configure.ac): Likewise. * modules/pipe-filter-gi-tests (Depends-on, configure.ac): Likewise. * tests/test-chown.h (nap): Rely on nicer usleep semantics. * tests/test-lchown.h (nap): Likewise. * tests/test-pipe-filter-gi2-main.c (small_nap): Likewise. * tests/test-stat-time.c (nap): Likewise. * tests/test-utimens-common.h (nap): Update comments. Signed-off-by: Eric Blake <ebb9@byu.net>
* chown: work around OpenBSD bugEric Blake2009-11-171-1/+11
| | | | | | | | | | | | | | | | | | | | | | chown(name,geteuid(),-1) failed to update the change time if name was already owned by the current effective user. Work around it by using chmod, which does not have this bug. Unfortunately, lchown has the same bug, but OpenBSD 4.0 lacks lchmod and lutimes, so there is no way to affect ctime without unlinking and recreating the symlink, which is too dangerous. * lib/chown.c (rpl_chown): Work around the bug. * lib/lchown.c (rpl_lchown): Attempt to do likewise. * m4/chown.m4 (gl_FUNC_CHOWN): Test for ctime bug. * m4/lchown.m4 (gl_FUNC_LCHOWN): Check for lchmod. * modules/chown (Depends-on): Add stdbool. * modules/lchown (Depends-on): Likewise. * doc/posix-functions/chown.texi (chown): Document the bug. * doc/posix-functions/lchown.texi (lchown): Likewise. * tests/test-lchown.h (test_chown): Relax test. Signed-off-by: Eric Blake <ebb9@byu.net>
* lchown: detect Solaris and FreeBSD bugEric Blake2009-11-141-0/+311
Solaris 9 and FreeBSD 7.2 lchown("link-to-file/",uid,gid) mistakenly changes ownership of "file". * lib/lchown.c (rpl_lchown): Work around bug. * m4/lchown.m4 (gl_FUNC_LCHOWN): Check for trailing slash bugs. * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Add witness. * modules/unistd (Makefile.am): Populate it. * lib/unistd.in.h (lchown): Update declaration. * doc/posix-functions/lchown.texi (lchown): Document the bug. * modules/lchown-tests: New file. * tests/test-lchown.h (test_lchown): Likewise. * tests/test-lchown.c (main): Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>