From owner-freebsd-emulation@FreeBSD.ORG Wed Dec 20 01:21:44 2006 Return-Path: X-Original-To: freebsd-emulation@FreeBSD.org Delivered-To: freebsd-emulation@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6ACDF16A403 for ; Wed, 20 Dec 2006 01:21:44 +0000 (UTC) (envelope-from tbourke@triptrop.cse.unsw.edu.au) Received: from note.orchestra.cse.unsw.EDU.AU (note.orchestra.cse.unsw.EDU.AU [129.94.242.24]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9769143C9F for ; Wed, 20 Dec 2006 01:21:43 +0000 (GMT) (envelope-from tbourke@triptrop.cse.unsw.edu.au) Received: From triptrop.cse.unsw.edu.au ([129.94.175.153]) (for ) By note With Smtp ; Wed, 20 Dec 2006 12:21:39 +1100 Received: from triptrop.cse.unsw.edu.au (localhost [127.0.0.1]) by triptrop.cse.unsw.edu.au (8.13.6/8.13.6) with ESMTP id kBK1KSV8099743 for ; Wed, 20 Dec 2006 12:20:28 +1100 (EST) (envelope-from tbourke@triptrop.cse.unsw.edu.au) Received: (from tbourke@localhost) by triptrop.cse.unsw.edu.au (8.13.6/8.13.6/Submit) id kBK1KS17099740 for freebsd-emulation@FreeBSD.org; Wed, 20 Dec 2006 12:20:28 +1100 (EST) (envelope-from tbourke) From: Timothy Bourke To: freebsd-emulation@FreeBSD.org Date: Wed, 20 Dec 2006 12:20:28 +1100 Message-ID: <20061220012028.GC799@triptrop.wlan.in.nicta.com.au> Mail-Followup-To: freebsd-emulation@FreeBSD.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="H8ygTp4AXg6deix2" Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-PGP-Key: http://www.cse.unsw.edu.au/~tbourke/pubkey.txt Cc: Subject: utimes affects permissions under emulators/linux_dist-gentoo-state3 X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Dec 2006 01:21:44 -0000 --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 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--