bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 4.5.9 test failure: fail-2eperm


From: Ryan . Oliver
Subject: Re: 4.5.9 test failure: fail-2eperm
Date: Tue, 22 Apr 2003 18:03:21 +1000

Greetings Jim et al,

Here's another possible fix for the tests/rm/fail-2eperms test for those of
us that dont have setuidgid on our systems (building this as part of a
Linux
>From Scratch build)

Firstly the offending shell script fragment in fail-2eperms...
------------------------------------------------------------
# Find a username with UID != 0, and a valid shell.
non_root_username=
names=`grep -v '[^:]*:[^:]*:0:' /etc/passwd| sed 's/:.*//'`
for name in $names; do
  su -c ':' $name && { non_root_username=$name; break; }
done
test "x$non_root_username" = x && framework_failure=1
------------------------------------------------------------

Firstly su -c ':' $name is broken on Solaris, su $name -c ':' would have
been better but I digress...

why not use

for name in $names; do
  retname=`su 'id -un' $name`
  test "$name" = "$retname" && { non_root_username=$name; break; }
done

at the least its a valid check if the shell is actually a shell (ie we get
some text back), and double checks that the user reports itself correctly.

Of course this wont work on solaris unless you use /usr/xpg4/bin/id , but
hey
its broken anyway for solaris ;-)
(wouldn't be too hard to check for solaris anyway).

Regards
Ryan Oliver






reply via email to

[Prev in Thread] Current Thread [Next in Thread]