bug-coreutils
[Top][All Lists]
Advanced

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

Re: Bug#569020: coreutils: failure of install-C test on GNU/kFreeBSD


From: Michael Stone
Subject: Re: Bug#569020: coreutils: failure of install-C test on GNU/kFreeBSD
Date: Tue, 09 Feb 2010 11:08:11 -0500
User-agent: Mutt/1.5.18 (2008-05-17)

On Tue, Feb 09, 2010 at 05:33:04PM +0100, Petr Salinger wrote:
the current coreutils fails to build on GNU/kFreeBSD.
Under 7.2 kernel 9 test fails,
under 8.0 kernel 1 test fail.

The failure under 7.2 kernel is due to limitation
of chroot and bind mounts, it is solved in 8.0 kernel.

Cool. I finally got a kfbsd qemu put together, but it's painfully slow.
I will stop trying to debug the 7.2 problems and upgrade the kernel. :-)

The remanining one is
tests/install/install-C which contains:
...
. $srcdir/test-lib.sh
skip_if_setgid_

mode1=0644
mode2=0755
mode3=2755
...

The problem have been described by Aurelien in
http://lists.debian.org/debian-bsd/2009/06/msg00009.html, see also
bellow.

First of all I should explain the differences between Linux and kFreeBSD
for the creation or new files/directory. kFreeBSD always use the group
of the parent directory for the group of the newly created
file/directory. Linux use the primary group of the user, except if the
parent directory is setgid or if the partition is mounted with the
option bsdgroups or grpid.

On the buildds the parent directory of the build directory has
uid=buildd, gid=sbuild. Note that the primary group of the user buildd
is buildd. Moreover it is setgid, so there should be no difference
between GNU/Linux and GNU/kFreeBSD.

dpkg-source -x first creates a temporary directory in the build
directory, and the permissions are explicitely set to 00700 (losing the
setgid bit). Then the .orig.tar.gz is untared here, patched are applied,
then the result is moved to the parent directory, and the the temporary
directory removed.

As a consequence, on GNU/Linux the temporary directory has lost the
setgid bit, and is still uid=buildd, gid=sbuild. Files are unpacked with
uid=buildd and gid=buildd, given that the temporary directory has lost
the setgid bit.

On GNU/kFreeBSD, the temporary directory has also lost the setgid bit,
and is also uid=buildd, gid=sbuild. Files are unpacked with uid=buildd
and gid=sbuild as the gid is determined by the parent directory.

Some coreutils tests fail if the files are not unpack with gid being the
primary group of the user. They are skipped if the directory is setgid,
but the kFreeBSD case is not taken into account.

I'll temporary change /buildd to gid=buildd on the buildds, but it looks
like we need a fix at some point. coreutils should probably be fixed,
but skipping the tests is probably not a good idea either. I wonder if
we should change dpkg to also force uid and gid of the temporary
directory while unpacking. I suspect that other packages than coreutils
might be affected. Guillem, as a dpkg maintainer, do you have an opinion
on that?

Probably better to just fix the coreutils test, and anything else which
makes assumptions of this sort. I think there are actually cases where
you can see the same behavior on a linux box, depending on the fs. I'll
look at the remaning failure, also cc'ing upstream in case someone's
already looked at it.

Mike Stone




reply via email to

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