Only fix permissions of configfiles on first install.

This commit is contained in:
Laurent Bigonville 2013-01-13 17:31:58 +01:00
parent 68adcbdb65
commit d54dd54840
3 changed files with 26 additions and 17 deletions

5
debian/changelog vendored
View file

@ -11,7 +11,10 @@ nut (2.6.5-2) UNRELEASED; urgency=low
* debian/nut-client.preinst: revert /etc/nut/nut.conf mangling done by older
versions of the postinst (Closes: #677054)
-- Laurent Bigonville <bigon@debian.org> Sun, 02 Dec 2012 13:48:20 +0100
[ Ivo De Decker ]
* Only fix permissions of configfiles on first install.
-- Laurent Bigonville <bigon@debian.org> Sun, 13 Jan 2013 17:31:15 +0100
nut (2.6.5-1) experimental; urgency=low

View file

@ -19,15 +19,18 @@ case "$1" in
# fi
# make sure that conffiles are secured and have the correct ownerships
if [ -d /etc/nut/ ] ; then
chown root:nut /etc/nut/
fi
for file in nut.conf upsmon.conf upssched.conf ; do
if [ -f /etc/nut/$file ] ; then
chown root:nut /etc/nut/$file
chmod 640 /etc/nut/$file
# on first install
if [ -z "$2" ] ; then
if [ -d /etc/nut/ ] ; then
chown root:nut /etc/nut/
fi
done
for file in nut.conf upsmon.conf upssched.conf ; do
if [ -f /etc/nut/$file ] ; then
chown root:nut /etc/nut/$file
chmod 640 /etc/nut/$file
fi
done
fi
# make sure that /var/run/nut exists and has the correct ownerships
if [ ! -d /var/run/nut ] ; then

View file

@ -19,15 +19,18 @@ case "$1" in
# fi
# make sure that conffiles are secured and have the correct ownerships
if [ -d /etc/nut/ ] ; then
chown root:nut /etc/nut/
fi
for file in ups.conf upsd.conf upsd.users ; do
if [ -f /etc/nut/$file ] ; then
chown root:nut /etc/nut/$file
chmod 640 /etc/nut/$file
# on first install
if [ -z "$2" ] ; then
if [ -d /etc/nut/ ] ; then
chown root:nut /etc/nut/
fi
done
for file in ups.conf upsd.conf upsd.users ; do
if [ -f /etc/nut/$file ] ; then
chown root:nut /etc/nut/$file
chmod 640 /etc/nut/$file
fi
done
fi
# make sure that /var/run/nut exists and has the correct ownerships
if [ ! -d /var/run/nut ] ; then