From owner-freebsd-bugs@FreeBSD.ORG Thu Mar 15 18:10:05 2007 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4E68A16A403 for ; Thu, 15 Mar 2007 18:10:05 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 2FB4413C458 for ; Thu, 15 Mar 2007 18:10:05 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l2FIA5Bk084322 for ; Thu, 15 Mar 2007 18:10:05 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l2FIA42Q084321; Thu, 15 Mar 2007 18:10:05 GMT (envelope-from gnats) Resent-Date: Thu, 15 Mar 2007 18:10:05 GMT Resent-Message-Id: <200703151810.l2FIA42Q084321@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, Murilo Opsfelder Araujo Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 913F916A402 for ; 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 ; 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 ; 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 To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.0 Cc: Subject: bin/110348: Add an option to do not automatically run ls with -A for root 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: Thu, 15 Mar 2007 18:10:05 -0000 >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: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Thu Mar 15 18:10:04 GMT 2007 >Closed-Date: >Last-Modified: >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: >Unformatted: