mock chroot builds run as owner of /

seth vidal skvidal at phy.duke.edu
Mon Aug 8 06:03:13 UTC 2005


On Sun, 2005-08-07 at 02:38 -0700, Roland McGrath wrote:
> I've just figured out why a test in a build was failing in mock builds but
> not in my normal rpmbuilds.  The difference is that in the mock build,
> `test -O /' succeeds for my uid (aka mockbuild), while in the real root
> that fails.  The test might as well have been test -w /, which tests
> writability.  It happens that I am the owner of /var/lib/mock/.../root,
> not just able to write it.
> 
> Would there be a problem with mock making the / in the chroot be owned by
> root?  That way the build as a normal user (mockbuild) would match the
> normal environment, in which "do I own / ?" or "can I write / ?" are ways
> to check for being root (and thus e.g. expect that file permissions won't
> be enforced in your tests).  As things are, this yields a false positive
> and fouls the package's logic that works around idiots who build as root.

I don't have any implicit reason to keep it that way but I kinda wonder
- why is anything testing for ownership of / even remotely reasonable?
Under what circumstances is that useful information rather than testing
for ownership of a specific dir or device?

-sv





More information about the fedora-extras-list mailing list