From owner-freebsd-stable@FreeBSD.ORG Sat Jan 10 13:41:11 2009 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 5265E106564A; Sat, 10 Jan 2009 13:41:11 +0000 (UTC) (envelope-from jh@saunalahti.fi) Received: from emh01.mail.saunalahti.fi (emh01.mail.saunalahti.fi [62.142.5.107]) by mx1.freebsd.org (Postfix) with ESMTP id 0CA978FC22; Sat, 10 Jan 2009 13:41:10 +0000 (UTC) (envelope-from jh@saunalahti.fi) Received: from saunalahti-vams (vs3-11.mail.saunalahti.fi [62.142.5.95]) by emh01-2.mail.saunalahti.fi (Postfix) with SMTP id A1BEA1AE10; Sat, 10 Jan 2009 15:24:05 +0200 (EET) Received: from emh02.mail.saunalahti.fi ([62.142.5.108]) by vs3-11.mail.saunalahti.fi ([62.142.5.95]) with SMTP (gateway) id A07EAF9E405; Sat, 10 Jan 2009 15:24:05 +0200 Received: from a91-153-125-115.elisa-laajakaista.fi (a91-153-125-115.elisa-laajakaista.fi [91.153.125.115]) by emh02.mail.saunalahti.fi (Postfix) with SMTP id 362632BD55; Sat, 10 Jan 2009 15:24:02 +0200 (EET) Date: Sat, 10 Jan 2009 15:24:02 +0200 From: Jaakko Heinonen To: Doug Barton Message-ID: <20090110132401.GA780@a91-153-125-115.elisa-laajakaista.fi> References: <496819DB.1030601@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <496819DB.1030601@FreeBSD.org> User-Agent: Mutt/1.5.18 (2008-05-17) X-Antivirus: VAMS 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: Sat, 10 Jan 2009 13:41:11 -0000 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