mirror of
https://git.freebsd.org/ports.git
synced 2025-07-18 09:49:18 -04:00
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 <sigsys@gmail.com>
Fixes: 02c038c8cc
This commit is contained in:
parent
65305c6542
commit
a4cc1509a9
6 changed files with 26 additions and 4 deletions
|
@ -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}/
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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}/
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue