From nobody Tue Feb 14 18:40:30 2023 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGVQ71w4jz3pqDY; Tue, 14 Feb 2023 18:40:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PGVQ71PDRz3nst; Tue, 14 Feb 2023 18:40:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676400031; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RTMRintATNFgzRZGS5hNmdjVJmaGeFQej+1U7HaS7G8=; b=nzhzWkVqnGGKJrsVdr8E2U96PZhOcfOPocnNUJQxiRdJAxXCaHj9Q5mh0XuqCy9XxZg0MF XsHNQQScB5RKWeNvJy6Vcx24hksjYusyyX6rH+fXgYmGADsRn+xYP6z3j6kV7eIEJT/AYr oZqshZkLQbURdzMGveLScPZVYohm/WPZR7QvmflTFRY1Sq/AUG1YwUVD04143LOZk64TP+ TqFKG7AiGwPm75KoAG/NF15dQAsGKEpgB20te9H1INX8f9nsuUobyB54Q+rfUIyeWxlVgj 0q8cJ8/yVc3sBQxUPjdi7V+mOnk7VX7aNCrO8XgzTFmH7Ec/jBdYyGsQNiUrng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676400031; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RTMRintATNFgzRZGS5hNmdjVJmaGeFQej+1U7HaS7G8=; b=ENmXXB02jHLlKz8V/PeNBQTlRNUQIh9CCOqcp2Z3bpSuYAouMi7kUAamdrR/lyFp8GeeCv n88jZ44eMN9WXt/LxImBco+sIfsc9TRsl/k05Yawi9jPeR1yCGUl6cAAB0u4JfNdZEnaXm cK6xyhi+bcpVDaDYcTIzNylZc/cpu8kAn0r7hZNUJJXOGnZdJWkoEBLsjNLvtdpCkwMyr8 LdutPFXpLGuDywPOzrd5myFpNo1K45vvn43OEAz1LTy7NjLqlArL/WltfSsDxZ1FD0FAjQ NguBwUUodFSCUHFFwVkjo9m0XZ0QPUH5z6KMNTNRrwkJdugtxGdU1ByF0G+CAw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676400031; a=rsa-sha256; cv=none; b=bZFqivi/8UsmK3Js+qCVyWeyETtp7CvLSYhseduQkaPDuz+JqvVIYdCR9CLi7GtGAOywf4 yW+UeW2tO1hGbssJNAyLJjBMDa0V/60Ph7XYN09h8huOHzFrTV0TfIv0Xm9vryxWXZvYe3 ViZEQA22SicLOWn9V+tQu7ihJsnavWWYRRqZMatyf4ZpMoc1BpSwe+sQIKSzDmSmNqruSW duq2qq5JXeJE7fneHakuXB4THJA/RIScGs3TMO2s4gLyGi5Zi/4x3SZq/FWn+aWgXl+LJz oZrZ20Pv8ys8Fwo50SZEA6urTvMfrLI9ULjoETc6kdJfLdPGknyVWC1qWRtK4A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGVQ70R58z18Zt; Tue, 14 Feb 2023 18:40:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 31EIeUR0011426; Tue, 14 Feb 2023 18:40:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EIeUn4011425; Tue, 14 Feb 2023 18:40:30 GMT (envelope-from git) Date: Tue, 14 Feb 2023 18:40:30 GMT Message-Id: <202302141840.31EIeUn4011425@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Cy Schubert Subject: git: 6558c2506990 - main - sysutils/nut*: Make nut file ownership fixes optional with default enabled List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6558c25069901328610d155bea362aeb7ab00f17 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/ports/commit/?id=6558c25069901328610d155bea362aeb7ab00f17 commit 6558c25069901328610d155bea362aeb7ab00f17 Author: Cy Schubert AuthorDate: 2023-02-13 18:57:30 +0000 Commit: Cy Schubert CommitDate: 2023-02-14 18:40:00 +0000 sysutils/nut*: Make nut file ownership fixes optional with default enabled The nut file ownership fixups due to the UID/GID change from uucp/uucp to nut/nut may not be desireable for all users. Some users with custom file ownership may wish ownership to remain untouched. This revision to the nut family of ports/packages allows users to optionally disable automatic fixup of nut file ownership. While at it, rather than use a hardcoded string for user/group ownerships, use the set parameters in Makefile. PR: 269497 suggested by: dvl --- UPDATING | 10 ++++++++++ sysutils/nut-devel/Makefile | 4 ++-- sysutils/nut-devel/files/nut.in | 11 +++++++---- sysutils/nut/Makefile | 4 ++-- sysutils/nut/files/nut.in | 11 +++++++---- 5 files changed, 28 insertions(+), 12 deletions(-) diff --git a/UPDATING b/UPDATING index 97843ae46b90..29ea2165e7e7 100644 --- a/UPDATING +++ b/UPDATING @@ -5,6 +5,16 @@ they are unavoidable. You should get into the habit of checking this file for changes each time you update your ports collection, before attempting any port upgrades. +20230313: + Affects: users of sysutils/nut* + AUTHOR: cy@FreeBSD.org + + The nut file ownership fixups due to the UID/GID change from uucp/uucp + to nut/nut may not be desireable for all users. Some users with custom + file ownership may wish ownership to remain untouched. This revision + to the nut family of ports/packages allows users to optionally disable + automatic fixup of nut file ownership. + 20230213: AFFECTS: users of security/logcheck AUTHOR: yasu@FreeBSD.org diff --git a/sysutils/nut-devel/Makefile b/sysutils/nut-devel/Makefile index 225b9ff4d86f..897c6440da75 100644 --- a/sysutils/nut-devel/Makefile +++ b/sysutils/nut-devel/Makefile @@ -1,6 +1,6 @@ PORTNAME= nut PORTVERSION= ${NUT_COMMIT_DATE} -PORTREVISION= 4 +PORTREVISION= 6 CATEGORIES= sysutils PKGNAMESUFFIX= -devel # MASTER_SITES= http://www.networkupstools.org/source/${PORTVERSION:R}/ @@ -60,7 +60,7 @@ IPMIPSU_DESC= Use nut-ipmipsu support (experimental) SSL_OFF_DESC= No SSL support USE_RC_SUBR= nut nut_upsmon nut_upslog -SUB_LIST+= STATEDIR=${STATEDIR} NUT_GROUP=${NUT_GROUP} +SUB_LIST+= STATEDIR=${STATEDIR} NUT_USER=${NUT_USER} NUT_GROUP=${NUT_GROUP} PLIST_SUB+= STATEDIR=${STATEDIR} PORTDOCS= * diff --git a/sysutils/nut-devel/files/nut.in b/sysutils/nut-devel/files/nut.in index ae9ee30f03f5..c9a86debbe32 100644 --- a/sysutils/nut-devel/files/nut.in +++ b/sysutils/nut-devel/files/nut.in @@ -31,17 +31,20 @@ pidfile="%%STATEDIR%%/upsd.pid" start_precmd="nut_prestart" stop_postcmd="nut_poststop" +nut_file_fixup=${nut_file_fixup:-"YES"} + nut_prestart() { # # As of PR/268960 UID/GID uucp is no longer used by nut. # Instead UID/GID nut is used. Make sure preexisting nut files # and directories are owned by nut instead of uucp. # - if [ -f ${nut_prefix}/etc/nut/upsd.users ]; then - chgrp %%NUT_GROUP%% ${nut_prefix}/etc/nut/upsd.users + if [ "${nut_file_fixup}" == "YES" ] + find ${nut_prefix}/etc/nut -user uucp -exec chown %%NUT_USER%% {} \; + find ${nut_prefix}/etc/nut -group uucp -exec chgrp %%NUT_GROUP%% {} \; + find %%STATEDIR%% -user uucp -exec chown %%NUT_USER%% {} \; + find %%STATEDIR%% -group uucp -exec chgrp %%NUT_GROUP%% {} \; fi - find %%STATEDIR%% -user uucp -exec chown nut {} \; - find %%STATEDIR%% -group uucp -exec chgrp nut {} \; ${nut_prefix}/sbin/upsdrvctl start } diff --git a/sysutils/nut/Makefile b/sysutils/nut/Makefile index 9a45bc5d7d1e..e017bc4e69af 100644 --- a/sysutils/nut/Makefile +++ b/sysutils/nut/Makefile @@ -1,6 +1,6 @@ PORTNAME= nut PORTVERSION= 2.8.0 -PORTREVISION= 19 +PORTREVISION= 21 CATEGORIES= sysutils MASTER_SITES= http://www.networkupstools.org/source/${PORTVERSION:R}/ @@ -50,7 +50,7 @@ IPMIPSU_DESC= Use nut-ipmipsu support (experimental) SSL_OFF_DESC= No SSL support USE_RC_SUBR= nut nut_upsmon nut_upslog -SUB_LIST+= STATEDIR=${STATEDIR} NUT_GROUP=${NUT_GROUP} +SUB_LIST+= STATEDIR=${STATEDIR} NUT_USER=${NUT_USER} NUT_GROUP=${NUT_GROUP} PLIST_SUB+= STATEDIR=${STATEDIR} PORTDOCS= * diff --git a/sysutils/nut/files/nut.in b/sysutils/nut/files/nut.in index ae9ee30f03f5..c9a86debbe32 100644 --- a/sysutils/nut/files/nut.in +++ b/sysutils/nut/files/nut.in @@ -31,17 +31,20 @@ pidfile="%%STATEDIR%%/upsd.pid" start_precmd="nut_prestart" stop_postcmd="nut_poststop" +nut_file_fixup=${nut_file_fixup:-"YES"} + nut_prestart() { # # As of PR/268960 UID/GID uucp is no longer used by nut. # Instead UID/GID nut is used. Make sure preexisting nut files # and directories are owned by nut instead of uucp. # - if [ -f ${nut_prefix}/etc/nut/upsd.users ]; then - chgrp %%NUT_GROUP%% ${nut_prefix}/etc/nut/upsd.users + if [ "${nut_file_fixup}" == "YES" ] + find ${nut_prefix}/etc/nut -user uucp -exec chown %%NUT_USER%% {} \; + find ${nut_prefix}/etc/nut -group uucp -exec chgrp %%NUT_GROUP%% {} \; + find %%STATEDIR%% -user uucp -exec chown %%NUT_USER%% {} \; + find %%STATEDIR%% -group uucp -exec chgrp %%NUT_GROUP%% {} \; fi - find %%STATEDIR%% -user uucp -exec chown nut {} \; - find %%STATEDIR%% -group uucp -exec chgrp nut {} \; ${nut_prefix}/sbin/upsdrvctl start }