From nobody Fri Feb 10 18:26:48 2023 X-Original-To: dev-commits-ports-all@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 4PD2J91Rlcz3pnCY; Fri, 10 Feb 2023 18:26:49 +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 4PD2J90spgz3LV7; Fri, 10 Feb 2023 18:26:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676053609; 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=9qDSaPcer7XQDezKptNIhGFyu/62oSXoK3BA9a+p9Ks=; b=I7sOnZtK6UdTZfbIiuL4duQnH5DHIlsGloSps/j0FEIn0KUFdq+EP92KitU08Dq/Q5Isb3 2P4kbK43GfiFa2jDmRI57EAjel8Zgp6n+N1wg8+AkYnEGbpqZwpiuLIz2QTFBNQ75fPxzA f8CaY3xwC5Qufl4aQEO55mQKKKE8BAxHK/dsBpjn+A1gp+uOEf4dmWNF1GkVWREpYulchu LddmzjdpZzHR3zdEz69GDrkP/cwjKilvECgWuf2CswUS/PmbUIv8dCmrmxXKqVwIrP39yK TjQA+pjuOWjj32DQg1mNsEqIhxG/OW74D6AnwWRT00vVKypQG52Zs8jjIcwdGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676053609; 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=9qDSaPcer7XQDezKptNIhGFyu/62oSXoK3BA9a+p9Ks=; b=A7b/PkO2xiJgWKFPAgVz5SLIJUXX0ETgZVSrqT/e/Zz8BHpx1yIoH+v8lFYPGxwfY7RENN u++2eTe8xpgNP6ea3A4+YGsEd87Z1DFyicp7bJxRJnqkgaEVMWMis3O7a6DL2EHxAGxGxr WrKbrrH78pj+MJ9MAcjigcACd6uMYWRxVS0h1BVwsTG5t9VvKmXADaZq9ecgzjDenUMPe1 YhbSFwaO8pIUkaLz+iM6cr5pE1ye9KrcjeWEWWe5rCV2pG7IQyYz5ArYdUn0W0Hr4qkOHK vKfkaToe5cSkJ3ji4mXhdxSoK8w3x7djQ+IaqTwLeG9JWceZteOqIHpc7jC8vw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676053609; a=rsa-sha256; cv=none; b=spedn8pQQvRXgK7zubUE3TQXPTnNjeIUimhSQ0gP/p48UXIpNc8p4gXW/5d6RNGC/UL5Po PXPTtj0Rf4SgpOVIDvaYB3Zu8qUrX7NlFqrdgwyhTGfEy3sa5NyUlBW5ecD7qGTly7JThr Ugy4h7TyZhAzoHXqW1uB2WRzZ+yX23wPKjRQjJj/2Rea67KLaJ7+WahokPhQvWqDR8snje 0LVSpeXUhTx/5gc+ne1rBXNx/Mp2fjgHdaPTZ5IFR0T3S9fnOQ1LTJj4JZeS91AAu2096R LgI/cawkc8utJg6L9nxdLz/dNno3BkndFcdyuAlydTWELy9qbT8iiIOuIWZ3kA== 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 4PD2J86vzZzT5S; Fri, 10 Feb 2023 18:26:48 +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 31AIQmX7058819; Fri, 10 Feb 2023 18:26:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31AIQmp2058818; Fri, 10 Feb 2023 18:26:48 GMT (envelope-from git) Date: Fri, 10 Feb 2023 18:26:48 GMT Message-Id: <202302101826.31AIQmp2058818@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: a4cc1509a9b6 - main - sysutils/nut*: Fix nut file access List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@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: a4cc1509a9b65367f76bbdf6b684035d0c3bfbc3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/ports/commit/?id=a4cc1509a9b65367f76bbdf6b684035d0c3bfbc3 commit a4cc1509a9b65367f76bbdf6b684035d0c3bfbc3 Author: Cy Schubert AuthorDate: 2023-02-09 16:03:07 +0000 Commit: Cy Schubert CommitDate: 2023-02-10 18:26:33 +0000 sysutils/nut*: Fix nut file access Preexisting nut files will have uucp group permissions, which will no longer be available to nut because it runs under its own GID. For the time being add code to nut_prestart() adjusting the ownership of the files to UID nut and GID nut. This code should be removed approximately a year from now as it is expected that most if not all nut installations will have correct file ownership by then. While here, also fix nut.newsyslog to refer to the new nut UID/GID. Reported by: avg, Mathieu Fixes: 02c038c8cc15 --- sysutils/nut-devel/Makefile | 2 +- sysutils/nut-devel/files/nut.in | 11 +++++++++++ sysutils/nut-devel/files/nut.newsyslog | 2 +- sysutils/nut/Makefile | 2 +- sysutils/nut/files/nut.in | 11 +++++++++++ sysutils/nut/files/nut.newsyslog | 2 +- 6 files changed, 26 insertions(+), 4 deletions(-) diff --git a/sysutils/nut-devel/Makefile b/sysutils/nut-devel/Makefile index 1f94319584fe..bff162740c92 100644 --- a/sysutils/nut-devel/Makefile +++ b/sysutils/nut-devel/Makefile @@ -1,6 +1,6 @@ PORTNAME= nut PORTVERSION= ${NUT_COMMIT_DATE} -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= sysutils PKGNAMESUFFIX= -devel # MASTER_SITES= http://www.networkupstools.org/source/${PORTVERSION:R}/ diff --git a/sysutils/nut-devel/files/nut.in b/sysutils/nut-devel/files/nut.in index 0e4cb9e8a618..ae9ee30f03f5 100644 --- a/sysutils/nut-devel/files/nut.in +++ b/sysutils/nut-devel/files/nut.in @@ -32,6 +32,17 @@ start_precmd="nut_prestart" stop_postcmd="nut_poststop" 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 + 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-devel/files/nut.newsyslog b/sysutils/nut-devel/files/nut.newsyslog index fc50b6c1be32..4a3a4350cee5 100644 --- a/sysutils/nut-devel/files/nut.newsyslog +++ b/sysutils/nut-devel/files/nut.newsyslog @@ -3,5 +3,5 @@ # see newsyslog.conf(5) for details # # logfilename [owner:group] mode count size when flags [/pid_file] [sig_num] -/var/log/nut/upsd.log uucp:uucp 644 7 100 * J /var/db/nut/upslog.pid +/var/log/nut/upsd.log nut:nut 644 7 100 * J /var/db/nut/upslog.pid diff --git a/sysutils/nut/Makefile b/sysutils/nut/Makefile index 81b4ebea94a9..3635e4d550fd 100644 --- a/sysutils/nut/Makefile +++ b/sysutils/nut/Makefile @@ -1,6 +1,6 @@ PORTNAME= nut PORTVERSION= 2.8.0 -PORTREVISION= 16 +PORTREVISION= 17 CATEGORIES= sysutils MASTER_SITES= http://www.networkupstools.org/source/${PORTVERSION:R}/ diff --git a/sysutils/nut/files/nut.in b/sysutils/nut/files/nut.in index 0e4cb9e8a618..ae9ee30f03f5 100644 --- a/sysutils/nut/files/nut.in +++ b/sysutils/nut/files/nut.in @@ -32,6 +32,17 @@ start_precmd="nut_prestart" stop_postcmd="nut_poststop" 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 + 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/files/nut.newsyslog b/sysutils/nut/files/nut.newsyslog index fc50b6c1be32..4a3a4350cee5 100644 --- a/sysutils/nut/files/nut.newsyslog +++ b/sysutils/nut/files/nut.newsyslog @@ -3,5 +3,5 @@ # see newsyslog.conf(5) for details # # logfilename [owner:group] mode count size when flags [/pid_file] [sig_num] -/var/log/nut/upsd.log uucp:uucp 644 7 100 * J /var/db/nut/upslog.pid +/var/log/nut/upsd.log nut:nut 644 7 100 * J /var/db/nut/upslog.pid