From owner-freebsd-bugs@FreeBSD.ORG Sun May 15 14:30:08 2011 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 62C2D1065673 for ; Sun, 15 May 2011 14:30:08 +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 380198FC12 for ; Sun, 15 May 2011 14:30:08 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p4FEU8jF001039 for ; Sun, 15 May 2011 14:30:08 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p4FEU8AS001035; Sun, 15 May 2011 14:30:08 GMT (envelope-from gnats) Resent-Date: Sun, 15 May 2011 14:30:08 GMT Resent-Message-Id: <201105151430.p4FEU8AS001035@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, Chris Rees Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B9FD10656B3 for ; Sun, 15 May 2011 14:20:40 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 615788FC1A for ; Sun, 15 May 2011 14:20:40 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p4FEKen4002441 for ; Sun, 15 May 2011 14:20:40 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id p4FEKeSh002440; Sun, 15 May 2011 14:20:40 GMT (envelope-from nobody) Message-Id: <201105151420.p4FEKeSh002440@red.freebsd.org> Date: Sun, 15 May 2011 14:20:40 GMT From: Chris Rees To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: misc/157062: [build] Add new owner variable: CONF(OWN|GROUP|MODE) 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: Sun, 15 May 2011 14:30:08 -0000 >Number: 157062 >Category: misc >Synopsis: [build] Add new owner variable: CONF(OWN|GROUP|MODE) >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: Sun May 15 14:30:07 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Chris Rees >Release: >Organization: >Environment: >Description: At the moment there are macros for ownership and permissions for files of class BIN, LIB, KMOD, LIBDATA, SHARE, MAN, NLS and INFO, but not for the class CONF. This leads to some anomalies, such as src/etc/Makefile hardcoding mode 644 for config files in /etc, and (worse) config files are installed as DATA (SHAREMODE?=${NOBINMODE} by ports. This means that all config files installed by ports are read-only, unlike their base counterparts -- not only is this inconsistent it also means that editing config files in vi forces me to use :wq! rather than ZZ to quit. >How-To-Repeat: Install a port with a config file. # ls -l `make -V PREFIX`/etc/`make -V PORTNAME`.conf* -r--r--r-- 1 root wheel 13467 Apr 22 12:14 /usr/local/etc/musicpd.conf -r--r--r-- 1 root wheel 13482 May 7 10:02 /usr/local/etc/musicpd.conf.sample Why are the config files read-only???? >Fix: The attached patch lays the necessary groundwork for a new macro or routine in bsd.port.mk . With suggestions on how to make sure the correct version of bsd.own.mk is sourced in buildworld I'll submit patches for src/etc as well. Patch attached with submission follows: Index: share/mk/bsd.own.mk =================================================================== RCS file: /exports/cvsroot-freebsd/src/share/mk/bsd.own.mk,v retrieving revision 1.103 diff -u -r1.103 bsd.own.mk --- share/mk/bsd.own.mk 10 May 2011 11:00:40 -0000 1.103 +++ share/mk/bsd.own.mk 14 May 2011 15:25:48 -0000 @@ -63,6 +63,15 @@ # SHAREMODE ASCII text file mode. [${NOBINMODE}] # # +# CONFDIR Base path for configuration files. [/etc] +# +# CONFOWN Configuration file owner. [root] +# +# CONFGRP Configuration file group. [wheel] +# +# CONFMODE Configuration file mode. [644] +# +# # DOCDIR Base path for system documentation (e.g. PSD, USD, # handbook, FAQ etc.). [${SHAREDIR}/doc] # @@ -145,6 +154,11 @@ SHAREGRP?= wheel SHAREMODE?= ${NOBINMODE} +CONFDIR?= /etc +CONFOWN?= root +CONFGRP?= wheel +CONFMODE?= 644 + MANDIR?= ${SHAREDIR}/man/man MANOWN?= ${SHAREOWN} MANGRP?= ${SHAREGRP} >Release-Note: >Audit-Trail: >Unformatted: