From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 8 20:39:16 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D21DC2DE for ; Tue, 8 Apr 2014 20:39:16 +0000 (UTC) Received: from spectrum.skysmurf.nl (spectrum.skysmurf.nl [82.95.125.145]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F7241160 for ; Tue, 8 Apr 2014 20:39:15 +0000 (UTC) Received: from spectrum.skysmurf.nl (mail.skysmurf.nl [192.168.42.4] (may be forged)) by spectrum.skysmurf.nl (8.14.7/8.14.7) with SMTP id s38KdDNT002460 for ; Tue, 8 Apr 2014 22:39:13 +0200 (CEST) (envelope-from freebsd@skysmurf.nl) Received: by spectrum.skysmurf.nl (sSMTP sendmail emulation); Tue, 08 Apr 2014 22:39:13 +0200 Date: Tue, 8 Apr 2014 22:39:13 +0200 From: "A.J. 'Fonz' van Werven" To: freebsd-hackers@freebsd.org Subject: Re: Letting "ls -l" display file permissions in octal Message-ID: <20140408203913.GA2340@spectrum.skysmurf.nl> References: <20140408184533.GA974@spectrum.skysmurf.nl> <4e735f74795e7212dd3269ec6b0aaaf0.authenticated@ultimatedns.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="azLHFNyN32YCQGCU" Content-Disposition: inline In-Reply-To: <4e735f74795e7212dd3269ec6b0aaaf0.authenticated@ultimatedns.net> X-PGP-Key: http://www.skysmurf.nl/~fonz/fonz_pubkey.asc User-Agent: Mutt/1.5.23 (2014-03-12) X-Mailman-Approved-At: Tue, 08 Apr 2014 21:25:14 +0000 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2014 20:39:16 -0000 --azLHFNyN32YCQGCU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Please note: someone else on the forums spotted a bug in my code: the snprintf() call in octalmode() in print.c uses sizeof, which actually refers to the size of the pointer rather than the size of the buffer itself. I've updated the patch to just use the literal value 6 instead (four octal digits, a space reserved for aclmode() and a terminating \0). Since the length of said buffer has been hardcoded to 20 in the calling function (I didn't do that, BTW), I think that should be ok. AvW --=20 I'm not completely useless, I can be used as a bad example. --azLHFNyN32YCQGCU Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBAgAGBQJTRF5xAAoJEAfP7gJTaCe84nsQAK2h7MNuFe8LfHHlmnAK3rCh 5wLe9P/mEUV72APGLMs9xpZ7E/lC8IyRLJhqsKTHiFWEUyLNkt8TCIpzzgAaMxN+ wcQdl44USYIBg65CW2uAqW9vTd/1y7bap5ameDdFUlD1Q9SYRraEK9pF1PSn8xZ9 vsc1C+WN24D3+OCGhWI8XuoHuOem0njptp2ZXJDqaKvoJmlQfEPXbgh5zt7OXXED EiEvK0pQleH1wJEwEnyiqOt1fCjrKh0Ot7DFP0yNhO2YoOR5NZC/Kn8uL4zuzLpW Qug5pfn9lMGLPGqrh+gBp1Cz1Q5ycM5aY/xykF37e8MizSJleExYjM3tEdZQCtgZ 9kLcNK71CupvsoD1/p/W9GuUUZq7RqCMkClsXT3Bns09fNtoPHEJ7n/iTm9QAIKx CvjmAbhS2/jL0KB50I8r5uLkSmt6/j5HBBtcNhW5u35KzmDvAXqEYfpaZM0pBVns 99hUOvCPdGrLgdW43J0lEwBILteYnsioihfPJBr/y2uBB+G57+liizGAxyNZ7i0o dzqOQ5FIOMu/BlWEKJyYq7TL1vNfwnlTQIi7zsUBxtK5MUOZDayiPCiU2WYz3Ztt dzv1jQcogaKm+FBIGW4ktfqGTlmdH2lGP9jH8OLgqKGAj2FaWna9OS1iiH78hx72 UqztAvE+Y0mt5CU2jhKG =rNsJ -----END PGP SIGNATURE----- --azLHFNyN32YCQGCU--