bug-coreutils
[Top][All Lists]
Advanced

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

Re: coreutils-6.9 build/check-root: test/rm failed on no-give-up


From: anirkko
Subject: Re: coreutils-6.9 build/check-root: test/rm failed on no-give-up
Date: Wed, 2 May 2007 23:03:33 +0200 (MET DST)

> From address@hidden Tue May  1 23:02:29 2007
> To: address@hidden
> Cc: address@hidden
> Subject: Re: coreutils-6.9 build/check-root: test/rm failed on no-give-up
> From: Jim Meyering <address@hidden>
> Date: Tue, 01 May 2007 22:59:24 +0200
> 
> address@hidden wrote:
...
> ...
> > fail=0
> > + setuidgid nobody env 
> > PATH=/build/coreutils-6.9_static-obj9_g412-b2175020070420-O3-mcpu=supersparc/tests/rm/../../src:/usr/local/build/bin:/usr/bin
> >  rm -rf d
> > fail=1
> > + test -d d
> > fail=1
> ...
> > FAIL: no-give-up
> 
> Thanks for reporting that.
> That test is failing because the setuidgid command
> is supposed to fail to remove "d", but it actually does
> remove the directory.
> 
> Please change that test so it uses these two setuidgid commands
> instead of the one it currently has:
> 
> setuidgid $NON_ROOT_USERNAME env PATH="$PATH" id -a
> setuidgid $NON_ROOT_USERNAME env PATH="$PATH" truss -o /tmp/rm-log rm -rf d 
> && fail=1
> 
> Then, the output from "id -a" might tell if setuidgid is doing its job.
> There's an off-chance that the syscalls in /tmp/rm-log may tell
> us what's happening.
> 

Hi
To the layperson, the truss output below looks like removal
of directory d was correctly denied and rm returns _exit(1),
and the output which is now not sent to /dev/null says
    "rm: cannot remove directory `d': Permission denied"
but the test failed again, anyway: this time probably because
of the truss (not the rm) returning ok.
Changed back to the original 'no-give-up' test, now all tests pass!

But I also noticed that the same script building coreutils,
running 'gmake' and 'gmake check', rebuilt everything in src
beforehand, which there should have been no reason for???

The only things I had done in the meantime was deleting a load
of 2-3 year old includes and libraries in /usr/local/include
and /usr/local/lib to restart clean, and installed the coreutils-6.9
despite the failed check, but those directories should NOT have been
in the respective search path's anyway:
my scripts unsetenv all LD_LIBRARY_PATH, LD_RUN_PATH, LIBS, LDFLAGS,
C_INCLUDE_PATH etc _before_ unpacking, configuring and building,
specifically using only special clean /usr/local/build/bin,
build/lib etc paths with freshly build bare necessities, and setting
     --prefix=/usr/local/...somewhere-else.../coreutils-6.9
as the installation directory, exactly to avoid such conflicts.

Sorry, checking 'env | grep /usr/local' shows that I missed CPP_FLAGS
which still had /usr/local/include in front. Could it have been that?
Or could it be that configure calls for /usr/local/lib anyway, even
when using --prefix=...something-else...??
Indeed, a 'grep' of configure finds things such as LIBS="-L/usr/local/lib $LIBS"
but I don't know if they are active when --prefix= says otherwise.

Well, I will delete the whole obj directory, run the script from scratch,
and look what happens now. If the culprit was any of the above, the
error should not return.

Greetings,
Arto


contents of /tmp/rm-log
--------------------------------------------------------------
execve("/build/coreutils-6.9_static-obj9_g412-b2175020070420-O3-mcpu=supersparc/tests/rm/../../src/rm",
 0xEFFFF770, 0xEFFFF780)  argc = 3
resolvepath("/usr/lib/ld.so.1", "/usr/lib/ld.so.1", 1023) = 16
open("/var/ld/ld.config", O_RDONLY)             Err#2 ENOENT
open("/usr/lib/libc.so.1", O_RDONLY)            = 3
fstat(3, 0xEFFFEDEC)                            = 0
mmap(0x00000000, 8192, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x6FFB0000
mmap(0x00000000, 712704, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x6FE80000
mmap(0x6FF24000, 30500, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 
3, 606208) = 0x6FF24000
open("/dev/zero", O_RDONLY)                     = 4
mmap(0x6FF2C000, 4408, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 
4, 0) = 0x6FF2C000
munmap(0x6FF16000, 57344)                       = 0
mmap(0x00000000, 8192, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE, 4, 0) = 
0x6FFA0000
memcntl(0x6FE80000, 101964, MC_ADVISE, 0x0003, 0, 0) = 0
close(3)                                        = 0
open("/usr/lib/libdl.so.1", O_RDONLY)           = 3
fstat(3, 0xEFFFEDEC)                            = 0
mmap(0x6FFB0000, 8192, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 
0x6FFB0000
close(3)                                        = 0
open("/usr/platform/SUNW,Ultra-1/lib/libc_psr.so.1", O_RDONLY) = 3
fstat(3, 0xEFFFEC4C)                            = 0
mmap(0x00000000, 8192, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x6FF90000
mmap(0x00000000, 16384, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x6FF80000
close(3)                                        = 0
close(4)                                        = 0
munmap(0x6FF90000, 8192)                        = 0
ioctl(0, TCGETA, 0xEFFFF584)                    = 0
lstat64("/", 0xEFFFF4F0)                        = 0
brk(0x0002BF98)                                 = 0
brk(0x0002DF98)                                 = 0
brk(0x0002DF98)                                 = 0
brk(0x0002FF98)                                 = 0
lstat64("d", 0xEFFFF478)                        = 0
getuid()                                        = 60001 [60001]
open64("d", O_RDONLY|O_NONBLOCK|O_NOCTTY)       = 3
fstat64(3, 0xEFFFF478)                          = 0
open64("/proc/self/fd", O_RDONLY)               = 4
stat64("/proc/self/fd/4/..", 0xEFFFEE78)        = 0
stat64("/proc/self", 0xEFFFEF10)                = 0
close(4)                                        = 0
open64("/proc/self/fd/3/.", O_RDONLY|O_NDELAY)  = 4
fcntl(4, F_SETFD, 0x00000001)                   = 0
fstat64(4, 0xEFFFEF40)                          = 0
close(3)                                        = 0
fstat64(4, 0xEFFFF1A0)                          = 0
getdents64(4, 0x0002F048, 1048)                 = 72
unlink("/proc/self/fd/4/f")                     Err#89 ENOSYS
open64(".", O_RDONLY)                           = 3
fchdir(4)                                       = 0
unlink("f")                                     = 0
fchdir(3)                                       = 0
close(3)                                        = 0
getdents64(4, 0x0002F048, 1048)                 = 0
fcntl(4, F_GETFD, 0x0002F08A)                   = 1
close(4)                                        = 0
rmdir("d")                                      Err#13 EACCES
write(2, " r m :  ", 4)                         = 4
write(2, " c a n n o t   r e m o v".., 24)      = 24
write(2, " ` d '", 3)                           = 3
brk(0x0002FF98)                                 = 0
brk(0x00031F98)                                 = 0
write(2, " :  ", 2)                             = 2
write(2, " P e r m i s s i o n   d".., 17)      = 17
write(2, "\n", 1)                               = 1
close(1)                                        = 0
close(2)                                        = 0
llseek(0, 0, SEEK_CUR)                          = 41024
_exit(1)


output of 'gmake check' (as root):
--------------------------------------------------------------
...
...
PASS: unread3
+ rm --version 
rm (GNU coreutils) 6.9
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software.  You may redistribute copies of it under the terms of
the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
There is NO WARRANTY, to the extent permitted by law.

Written by Paul Rubin, David MacKenzie, Richard Stallman, and Jim Meyering.
PRIV_CHECK_ARG=require-root
+ . /build/coreutils-6.9/tests/rm/../priv-check 
who=as root
+ id -u 
my_uid=0
+ test 0 = 0 
+ test 0 = 0 
+ : nobody 
+ id -u nobody 
coreutils_non_root_uid=60001
+ test 0 = 0 
+ test 60001 = 0 
give_msg=no
+ test no = yes 
+ pwd 
pwd=/build/coreutils-6.9_static-obj9_g412-b2175020070420-O3-mcpu=supersparc/tests/rm
+ echo /build/coreutils-6.9/tests/rm/no-give-up 
+ sed s,.*/,, 
t0=no-give-up.tmp
tmp=no-give-up.tmp/19044
+ trap status=$?; cd "$pwd" && chmod -R u+rwx $t0 && rm -rf $t0 && exit $status 
0 
+ trap (exit $?); exit $? 1 2 13 15 
framework_failure=0
+ mkdir -p no-give-up.tmp/19044 
+ cd no-give-up.tmp/19044 
+ mkdir d 
+ touch d/f 
+ chown -R nobody d 
+ chmod u=rwx . 
+ test 0 = 1 
fail=0
+ setuidgid nobody env 
PATH=/build/coreutils-6.9_static-obj9_g412-b2175020070420-O3-mcpu=supersparc/tests/rm/../../src:/usr/local/build/bin:/usr/bin
 id -a 
uid=60001(nobody) gid=60001(nobody) groups=60001(nobody)
+ setuidgid nobody env 
PATH=/build/coreutils-6.9_static-obj9_g412-b2175020070420-O3-mcpu=supersparc/tests/rm/../../src:/usr/local/build/bin:/usr/bin
 truss -o /tmp/rm-log rm -rf d 
rm: cannot remove directory `d': Permission denied
fail=1
+ test -d d 
+ test -f d/f 
+ exit 1 
+ exit 1 
status=1
+ cd 
/build/coreutils-6.9_static-obj9_g412-b2175020070420-O3-mcpu=supersparc/tests/rm
 
+ chmod -R u+rwx no-give-up.tmp 
+ rm -rf no-give-up.tmp 
+ exit 1 
FAIL: no-give-up
...
...
======================================
1 of 34 tests failed
(2 tests were not run)
Please report to address@hidden
======================================
gmake[1]: *** [check-TESTS] Error 1
gmake[1]: Leaving directory ...
...
...





reply via email to

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