Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Dec 2006 12:20:28 +1100
From:      Timothy Bourke <timbob@bigpond.com>
To:        freebsd-emulation@FreeBSD.org
Subject:   utimes affects permissions under emulators/linux_dist-gentoo-state3
Message-ID:  <20061220012028.GC799@triptrop.wlan.in.nicta.com.au>

next in thread | raw e-mail | index | archive | help

--H8ygTp4AXg6deix2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Under FreeBSD 6.1-RELEASE-p11 with linux_dist-gentoo-stage3-2006.0_2, I
find that, on my laptop at least, files installed by portage have
incorrect permissions.

It seems that the problem can be reduced to utimes(). The following
program also unexpectedly changes file permissions but not m/atimes:
    #include <sys/time.h>

    int main(int argc, char** argv)
    {
        struct timeval timep[2];

        timep[0].tv_sec = timep[1].tv_sec = 3600;
        timep[0].tv_usec = timep[1].tv_usec = 0;

        if (argc > 1)
            utimes(argv[1], timep);

        return 0;
    }


e.g.
    # chroot /usr/local/gentoo-stage3 /bin/bash
    # cc -o utimestest utimestest.c
    # touch blah
    # chmod 644; ls -l blah
    -rw-r--r--  1 root root 0 Dec 20 00:55 blah
    # ./utimestest blah; ls -l blah
    -r--rwS---  1 root root 0 Dec 20 00:55 blah

This happens regardless of whether the executable is run inside or
outside a chroot. The executable works as expected if compiled under
FreeBSD.

Before investigating further, possibly trying the utimes linuxulator
patch posted earlier, I wonder whether anybody else has had a similar
problem?

Tim.

--H8ygTp4AXg6deix2
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.4 (FreeBSD)

iD8DBQFFiI/ctKVK1sFb0ecRAgaLAJ9lBxtW3ebLFtMeq46JEbgZ4C5YkgCfc58d
oRlC/sot0jJm86K6rNo+aPA=
=yfnF
-----END PGP SIGNATURE-----

--H8ygTp4AXg6deix2--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20061220012028.GC799>