From owner-freebsd-stable@FreeBSD.ORG Mon Oct 27 05:03:56 2008 Return-Path: Delivered-To: freebsd-stable@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3588A106566C for ; Mon, 27 Oct 2008 05:03:56 +0000 (UTC) (envelope-from andrew@areilly.bpa.nu) Received: from nskntmtas03p.mx.bigpond.com (nskntmtas03p.mx.bigpond.com [61.9.168.143]) by mx1.freebsd.org (Postfix) with ESMTP id B6E438FC08 for ; Mon, 27 Oct 2008 05:03:55 +0000 (UTC) (envelope-from andrew@areilly.bpa.nu) Received: from nskntotgx01p.mx.bigpond.com ([124.188.162.219]) by nskntmtas03p.mx.bigpond.com with ESMTP id <20081027050354.KIDI5533.nskntmtas03p.mx.bigpond.com@nskntotgx01p.mx.bigpond.com> for ; Mon, 27 Oct 2008 05:03:54 +0000 Received: from areilly.bpa.nu ([124.188.162.219]) by nskntotgx01p.mx.bigpond.com with ESMTP id <20081027050349.JBIE3509.nskntotgx01p.mx.bigpond.com@areilly.bpa.nu> for ; Mon, 27 Oct 2008 05:03:49 +0000 Received: (qmail 57446 invoked by uid 501); 27 Oct 2008 05:03:30 -0000 Date: Mon, 27 Oct 2008 16:03:30 +1100 From: Andrew Reilly To: Gavin Atkinson Message-ID: <20081027050330.GA55310@duncan.reilly.home> References: <20081026103133.B42478@ury.york.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20081026103133.B42478@ury.york.ac.uk> User-Agent: Mutt/1.4.2.3i X-RPD-ScanID: Class unknown; VirusThreatLevel unknown, RefID str=0001.0A150204.49054BB5.0063:SCFSTAT2704298,ss=1,fgs=0 Cc: Yannick Cadin , freebsd-stable@FreeBSD.org Subject: Re: 2 (very old) bugs? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2008 05:03:56 -0000 On Sun, Oct 26, 2008 at 10:43:04AM +0000, Gavin Atkinson wrote: > On Sun, 26 Oct 2008, Yannick Cadin wrote: > > >- first in the stat command. Only with the -x option. If you execute stat > >-x on /tmp or /usr/bin/passwd parameters for example, the numeric > >representation of mode is wrong. The "special" bits are always 0. No > >suid-bit, no sticky bit! > > Although this does seem wrong to me, the code does it deliberately. I'm > not sure why, it may be to be compatible with Linux (as the -x option is > documented in the man page as giving "Linux format" output). I don't know the history, but must guess from what you've said that it was attempting to be compatible with an old linux stat, beause the one that I have installed in /usr/compat/linux/usr/bin/stat produces quite different output: duncan [209]$ /usr/compat/linux/usr/bin/stat /usr/bin/passwd File: `/usr/bin/passwd' Size: 7832 Blocks: 16 IO Block: 4096 regular file Device: 7ah/122d Inode: 33728080 Links: 2 Access: (4555/-r-sr-xr-x) Uid: ( 0/ root) Gid: ( 0/ wheel) Access: 2008-10-25 12:38:00.000000000 +1100 Modify: 2008-10-25 12:38:00.000000000 +1100 Change: 2008-10-25 12:38:00.000000000 +1100 duncan [210]$ stat -x /usr/bin/passwd File: "/usr/bin/passwd" Size: 7832 FileType: Regular File Mode: (0555/-r-sr-xr-x) Uid: ( 0/ root) Gid: ( 0/ wheel) Device: 0,122 Inode: 33728080 Links: 2 Access: Sat Oct 25 12:38:00 2008 Modify: Sat Oct 25 12:38:00 2008 Change: Sat Oct 25 12:38:00 2008 Since this clearly isn't close enough for the purposes of simple shell or sed scripts, I can understand why this bug has gone unfixed for so long... Cheers, Andrew