diff options
author | Pádraig Brady <P@draigBrady.com> | 2014-05-19 18:21:57 +0100 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2014-05-21 11:18:27 +0100 |
commit | 7a63d6395ac117b753a18468a9b3f5ed95d176d4 (patch) | |
tree | c01b1115f71bd4a4b98b1dc6f9383d4228507e5f /init.cfg | |
parent | 0c4729516baa2fbefb0af66c38f434b1f7519078 (diff) | |
download | coreutils-7a63d6395ac117b753a18468a9b3f5ed95d176d4.tar.xz |
tests: use chroot --user rather than internal setuidgid tool
* init.cfg (require_root_): Adjust to use chroot, and make
`require_built_ chroot` implicit when chroot used in the test.
* po/POTFILES.in: Remove reference to setuidgid tool.
* src/.gitignore: Likewise.
* src/local.mk: Likewise.
* src/setuidgid.c: Remove.
* tests/cp/preserve-gid.sh: s/setuidgid/chroot --user/.
* tests/cp/special-bits.sh: Likewise.
* tests/id/setgid.sh: Likewise.
* tests/misc/truncate-owned-by-other.sh
* tests/mv/sticky-to-xpart.sh: Likewise.
* tests/rm/fail-2eperm.sh: Likewise.
* tests/rm/no-give-up.sh: Likewise.
* tests/touch/now-owned-by-other.sh: Likewise.
* tests/misc/chroot-fail.sh: Skip if chroot not built.
Diffstat (limited to 'init.cfg')
-rw-r--r-- | init.cfg | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -393,12 +393,14 @@ or use the shortcut target of the toplevel Makefile, fi } -# Test whether we can run our just-built rm setuidgid-to-root, +# Test whether we can run our just-built root owned rm, # i.e., that $NON_ROOT_USERNAME has access to the build directory. -setuidgid_has_perm_() +nonroot_has_perm_() { + require_built_ chroot + local rm_version=$( - setuidgid $NON_ROOT_USERNAME env PATH="$PATH" rm --version | + chroot --user=$NON_ROOT_USERNAME / env PATH="$PATH" rm --version | sed -n '1s/.* //p' ) case ":$rm_version:" in @@ -413,10 +415,10 @@ require_root_() NON_ROOT_USERNAME=${NON_ROOT_USERNAME=nobody} NON_ROOT_GROUP=${NON_ROOT_GROUP=$(id -g $NON_ROOT_USERNAME)} - # When the current test invokes setuidgid, call setuidgid_has_perm_ + # When the current test invokes chroot, call nonroot_has_perm_ # to check for a common problem. - grep '^[ ]*setuidgid' "../$0" \ - && { setuidgid_has_perm_ \ + grep '^[ ]*chroot' "../$0" \ + && { nonroot_has_perm_ \ || skip_ "user $NON_ROOT_USERNAME lacks execute permissions"; } } |