[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: coreutils-6.3: install: basic-1 fails
From: |
Jim Meyering |
Subject: |
Re: coreutils-6.3: install: basic-1 fails |
Date: |
Thu, 05 Oct 2006 10:43:14 +0200 |
Bauke Jan Douma <address@hidden> wrote:
...
>>> $> ls -l /sw/coreutils/coreutils-6.3/tests/install/../../src/dd
>>> -rwx--x--x 1 root staff 45532 Oct 3 18:06
>>> /sw/coreutils/coreutils-6.3/tests/install/../../src/dd
>> That file is readable only by root.
>> So if you're running tests as some other user, that would
>> explain the failure you saw.
>
> Yes, I am running the tests as root, but apparently the basic-1
> test re-runs itself as user nobody (65534), which explains the
> failure.
>
> Presently though that doesn't explain, to me at least, why
> 'require-non-root' is a show-stopper when I'm running the
> make check as root initially.
The main problem is that building as "root" is generally considered
to be a bad idea, from a security standpoint. As such, running the
tests that way is rarely tested.
I've fixed it like this:
2006-10-05 Jim Meyering <address@hidden>
* tests/install/basic-1: Skip the latter part of this test if the
just-built dd binary is not readable. Otherwise, this test would fail
when binaries were created as root. Reported by Bauke Jan Douma in
<http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/8433>.
Index: tests/install/basic-1
===================================================================
RCS file: /fetish/cu/tests/install/basic-1,v
retrieving revision 1.21
diff -u -r1.21 basic-1
--- tests/install/basic-1 18 Sep 2006 22:09:50 -0000 1.21
+++ tests/install/basic-1 5 Oct 2006 08:30:20 -0000
@@ -58,7 +58,20 @@
# Make sure strip works.
dd=dd$EXEEXT
dd2=dd2$EXEEXT
-cp $pwd/../../src/$dd . || fail=1
+
+just_built_dd=$pwd/../../src/$dd
+
+test -r $just_built_dd || \
+ {
+ cat 1>&2 <<EOF
+$0: WARNING!!!
+Your just-built dd binary, $just_built_dd
+is not readable, so skipping the remaining tests in this file.
+EOF
+ exit 77
+ }
+
+cp $just_built_dd . || fail=1
cp $dd $dd2 || fail=1
strip $dd2 || \