Updated buildscripts (v2.2.8)

Erik-Jan ej.lfs at xs4all.nl
Mon Apr 21 08:41:55 PDT 2003

Hi Bill,

I've found something: the fail-2eperm-test searches for a non-root user.
When it finds one, it su's to it and does the test (tries to rm a
directory that doesn't belong to that user).

Two things can go wrong:

1) When looking for the non-root-user, it checks if the shell connected
to that user is a valid one. But a shell like /bin/true passes this
test, it exits with a 0 but it doesn't execute any commands. I've fixed
this by actually executing a whoami-command in the shell and testing its
2) If the shell connected to the non-root-user is a bash-shell, it uses
BASH_ENV to find a .bash-rc-file. Because BASH_ENV points to
/root/.bashrc, this gives an error: "bash: /root/.bashrc: Permission

I've made a patch (coreutils-5.0) to correct this. Apply it this way:
untar a fresh coreutils
cd into it
patch -Np1 -i path/to/patches/coreutils-fail-2eperm.patch

now you should be able to configure, make and make check-root without
any failures.

For the user-tests: can you try to chown all the test to the
plfstest-user? In the coreutils-5.0 dir do this: (assuming that you've
already made the plfstest-user and groups)
chown -R plfstest:plfstest tests

and then you should be able to do the usertests:
su -c "make check" plfstest

-------------- next part --------------
diff -Naur -i coreutils-5.0-orig/tests/rm/fail-2eperm coreutils-5.0/tests/rm/fail-2eperm
--- coreutils-5.0-orig/tests/rm/fail-2eperm	Mon Apr 21 17:17:25 2003
+++ coreutils-5.0/tests/rm/fail-2eperm	Mon Apr 21 17:11:20 2003
@@ -23,7 +23,8 @@
 names=`grep -v '[^:]*:[^:]*:0:' /etc/passwd| sed 's/:.*//'`
 for name in $names; do
-  su -c ':' $name && { non_root_username=$name; break; }
+  test "`BASH_ENV="" su -c 'whoami' $name`" = $name && 
+	{ non_root_username=$name; break; }
 test "x$non_root_username" = x && framework_failure=1
@@ -41,7 +42,7 @@
-su -c 'rm -rf a' $non_root_username 2> out && fail=1
+BASH_ENV="" su -c 'rm -rf a' $non_root_username 2> out && fail=1
 cat <<\EOF > exp
 rm: cannot remove `a/b': Operation not permitted

More information about the lfs-dev mailing list