Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Jan 2009 15:24:02 +0200
From:      Jaakko Heinonen <jh@saunalahti.fi>
To:        Doug Barton <dougb@FreeBSD.org>
Cc:        Yannick Cadin <yannick@diablotin.fr>, freebsd-stable@freebsd.org
Subject:   Re: 2 (very old) bugs?
Message-ID:  <20090110132401.GA780@a91-153-125-115.elisa-laajakaista.fi>
In-Reply-To: <496819DB.1030601@FreeBSD.org>
References:  <EFD58FB6-55C8-4903-BCB1-1C9E4852C271@diablotin.fr> <496819DB.1030601@FreeBSD.org>

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

Hi,

On 2009-01-09, Doug Barton wrote:
> 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!
> 
> Our version of stat(1) is essentially an exact duplicate of the code
> from NetBSD. I imported this originally, but I have not not had time
> to merge changes for a while now. If anyone is interested in taking
> this on have a look at:
> 
> http://cvsweb.netbsd.org/bsdweb.cgi/src/usr.bin/stat/

The reported bug still exists in the NetBSD version too. I believe that
the following patch fixes the bug:

%%%
Index: usr.bin/stat/stat.c
===================================================================
--- usr.bin/stat/stat.c	(revision 186786)
+++ usr.bin/stat/stat.c	(working copy)
@@ -108,7 +108,8 @@ __FBSDID("$FreeBSD$");
 #define LINUX_FORMAT \
 	"  File: \"%N\"%n" \
 	"  Size: %-11z  FileType: %HT%n" \
-	"  Mode: (%04OLp/%.10Sp)         Uid: (%5u/%8Su)  Gid: (%5g/%8Sg)%n" \
+	"  Mode: (%OMp%03OLp/%.10Sp)         " \
+	"Uid: (%5u/%8Su)  Gid: (%5g/%8Sg)%n" \
 	"Device: %Hd,%Ld   Inode: %i    Links: %l%n" \
 	"Access: %Sa%n" \
 	"Modify: %Sm%n" \
%%%

-- 
Jaakko



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