From owner-freebsd-bugs@FreeBSD.ORG Tue Feb 10 18:10:02 2009 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0713C10656BC for ; Tue, 10 Feb 2009 18:10:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id D1D668FC22 for ; Tue, 10 Feb 2009 18:10:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n1AIA1q6060141 for ; Tue, 10 Feb 2009 18:10:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n1AIA1gk060140; Tue, 10 Feb 2009 18:10:01 GMT (envelope-from gnats) Resent-Date: Tue, 10 Feb 2009 18:10:01 GMT Resent-Message-Id: <200902101810.n1AIA1gk060140@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Jaakko Heinonen Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79E80106568E for ; Tue, 10 Feb 2009 18:08:20 +0000 (UTC) (envelope-from jaakko@saunalahti.fi) Received: from gw01.mail.saunalahti.fi (gw01.mail.saunalahti.fi [195.197.172.115]) by mx1.freebsd.org (Postfix) with ESMTP id 36DC78FC23 for ; Tue, 10 Feb 2009 18:08:20 +0000 (UTC) (envelope-from jaakko@saunalahti.fi) Received: from ws64.jh.dy.fi (a91-153-125-115.elisa-laajakaista.fi [91.153.125.115]) by gw01.mail.saunalahti.fi (Postfix) with ESMTP id 6243415197A for ; Tue, 10 Feb 2009 20:08:18 +0200 (EET) Received: from ws64.jh.dy.fi (localhost [127.0.0.1]) by ws64.jh.dy.fi (8.14.3/8.14.3) with ESMTP id n1AI8ImN005867 for ; Tue, 10 Feb 2009 20:08:18 +0200 (EET) (envelope-from jaakko@ws64.jh.dy.fi) Received: (from jaakko@localhost) by ws64.jh.dy.fi (8.14.3/8.14.3/Submit) id n1AI8HPh005866; Tue, 10 Feb 2009 20:08:18 +0200 (EET) (envelope-from jaakko) Message-Id: <200902101808.n1AI8HPh005866@ws64.jh.dy.fi> Date: Tue, 10 Feb 2009 20:08:18 +0200 (EET) From: Jaakko Heinonen To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: bin/131569: [patch] stat(1) -x doesn't print the file mode correctly X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2009 18:10:02 -0000 >Number: 131569 >Category: bin >Synopsis: [patch] stat(1) -x doesn't print the file mode correctly >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Feb 10 18:10:01 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Jaakko Heinonen >Release: FreeBSD 7.1-STABLE / 8.0-CURRENT >Organization: >Environment: >Description: The octal representation of the file mode displayed with stat(1) -x option ignores suid, sgid and sticky bits. This was reported on -stable: http://lists.freebsd.org/pipermail/freebsd-stable/2008-October/046195.html >How-To-Repeat: $ touch foo $ chmod 4755 foo $ stat -x foo | grep Mode Mode: (0755/-rwsr-xr-x) Uid: ( 1000/ jaakko) Gid: ( 0/ wheel) After applying the patch: $ stat -x foo | grep Mode Mode: (4755/-rwsr-xr-x) Uid: ( 1000/ jaakko) Gid: ( 0/ wheel) >Fix: --- stat--x-file-mode.diff begins here --- 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" \ --- stat--x-file-mode.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: