From nobody@FreeBSD.org  Thu Mar 15 18:05:13 2007
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 913F916A402
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 15 Mar 2007 18:05:13 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [69.147.83.33])
	by mx1.freebsd.org (Postfix) with ESMTP id 69C3513C45A
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 15 Mar 2007 18:05:13 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id l2FI5DJ0059309
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 15 Mar 2007 18:05:13 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id l2FI5D9F059298;
	Thu, 15 Mar 2007 18:05:13 GMT
	(envelope-from nobody)
Message-Id: <200703151805.l2FI5D9F059298@www.freebsd.org>
Date: Thu, 15 Mar 2007 18:05:13 GMT
From: Murilo Opsfelder Araujo<mopsfelder@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Add an option to do not automatically run ls with -A for root
X-Send-Pr-Version: www-3.0

>Number:         110348
>Category:       bin
>Synopsis:       Add an option to do not automatically run ls with -A for root
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Mar 15 18:10:04 GMT 2007
>Closed-Date:    Thu Mar 15 21:17:09 GMT 2007
>Last-Modified:  Thu Mar 15 21:17:09 GMT 2007
>Originator:     Murilo Opsfelder Araujo
>Release:        7.0-CURRENT
>Organization:
Personal
>Environment:
FreeBSD soc90.opsfelder.eti.br 7.0-CURRENT FreeBSD 7.0-CURRENT #0: Wed Mar 14 20:30:36 BRT 2007     root@soc90:/usr/obj/usr/src/sys/PANDA  i386
>Description:
ls automatically add -A option for root user. I believe it's better to have a way to disable this at buildworld time.

This patch implements an option NO_LSAUTODOT, that can be used on make.conf to disable that feature.
>How-To-Repeat:

>Fix:
Index: bin/ls/Makefile
===================================================================
RCS file: /home/ncvs/src/bin/ls/Makefile,v
retrieving revision 1.26
diff -u -r1.26 Makefile
--- bin/ls/Makefile	25 May 2004 14:53:47 -0000	1.26
+++ bin/ls/Makefile	15 Mar 2007 17:45:14 -0000
@@ -6,6 +6,10 @@
 DPADD=	${LIBUTIL}
 LDADD=	-lutil
 
+.if defined(NO_LSAUTODOT)
+CFLAGS+= -DNO_LSAUTODOT
+.endif
+
 .if !defined(RELEASE_CRUNCH)
 CFLAGS+= -DCOLORLS
 DPADD+=	${LIBTERMCAP}
Index: bin/ls/ls.c
===================================================================
RCS file: /home/ncvs/src/bin/ls/ls.c,v
retrieving revision 1.85
diff -u -r1.85 ls.c
--- bin/ls/ls.c	24 Mar 2006 17:09:03 -0000	1.85
+++ bin/ls/ls.c	15 Mar 2007 17:45:17 -0000
@@ -338,8 +338,10 @@
 	argv += optind;
 
 	/* Root is -A automatically unless -I. */
+#ifndef NO_LSAUTODOT
 	if (!f_listdot && getuid() == (uid_t)0 && !f_noautodot)
 		f_listdot = 1;
+#endif
 
 	/* Enabling of colours is conditional on the environment. */
 	if (getenv("CLICOLOR") &&
Index: share/examples/etc/make.conf
===================================================================
RCS file: /home/ncvs/src/share/examples/etc/make.conf,v
retrieving revision 1.279
diff -u -r1.279 make.conf
--- share/examples/etc/make.conf	17 Jan 2007 12:43:06 -0000	1.279
+++ share/examples/etc/make.conf	15 Mar 2007 17:45:18 -0000
@@ -106,6 +106,7 @@
 #NO_MODULES=		# do not build modules with the kernel
 #NO_SHARE=		# do not go into the share subdir
 #NO_SHARED= 		# build /bin and /sbin statically linked (bad idea)
+#NO_LSAUTODOT=		# do not automatically enable -A for root on /bin/ls
 #
 # Variables that control how ppp(8) is built.
 #PPP_NO_NAT= 		# do not build with NAT support (see make.conf(5))
>Release-Note:
>Audit-Trail:

From: Kris Kennaway <kris@obsecurity.org>
To: Murilo Opsfelder Araujo <mopsfelder@gmail.com>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: bin/110348: Add an option to do not automatically run ls with -A for root
Date: Thu, 15 Mar 2007 17:09:38 -0400

 On Thu, Mar 15, 2007 at 06:05:13PM +0000, Murilo Opsfelder Araujo wrote:
 
 > ls automatically add -A option for root user. I believe it's better to have a way to disable this at buildworld time.
 > 
 > This patch implements an option NO_LSAUTODOT, that can be used on make.conf to disable that feature.
 
 A build option is unnecessary for something so minor and easily worked
 around, just set an alias of ls=ls -I for your root shell.
 
 Kris
State-Changed-From-To: open->closed 
State-Changed-By: linimon 
State-Changed-When: Thu Mar 15 21:16:43 UTC 2007 
State-Changed-Why:  
As kris mentioned, this is best done on individual systems. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=110348 
>Unformatted:
