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...


freebsd-stable@freebsd.org mailing list
To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org"