summaryrefslogtreecommitdiffstats
path: root/debianpkg
diff options
context:
space:
mode:
authorMartin Winter <mwinter@opensourcerouting.org>2018-03-19 19:16:09 +0100
committerMartin Winter <mwinter@opensourcerouting.org>2018-03-27 16:05:47 +0200
commite681915e6488e4287e9a0eeddafcc3c7662084c1 (patch)
tree3057df4d77b8c84abd2fe660e8a112cd4d4a9854 /debianpkg
parentdebianpkg: Add support for Ubuntu 18.04 (diff)
downloadfrr-e681915e6488e4287e9a0eeddafcc3c7662084c1.tar.xz
frr-e681915e6488e4287e9a0eeddafcc3c7662084c1.zip
debianpkg: Fix maintainer-script-should-not-use-recursive-chown-or-chmod
New lintian version causes warning for recursive chown and chmod. This change avoids the the recursive operation by splitting it into to commands Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
Diffstat (limited to 'debianpkg')
-rw-r--r--debianpkg/frr.postinst3
-rw-r--r--debianpkg/frr.preinst6
2 files changed, 6 insertions, 3 deletions
diff --git a/debianpkg/frr.postinst b/debianpkg/frr.postinst
index cbc45f03e..972f8c050 100644
--- a/debianpkg/frr.postinst
+++ b/debianpkg/frr.postinst
@@ -12,7 +12,8 @@ frrvtygid=`egrep "^frrvty:" $GROUPFILE | awk -F ":" '{ print $3 }'`
[ -n ${frrgid} ] || (echo "No gid for frr in ${GROUPFILE}" && /bin/false)
[ -n ${frrVTYgid} ] || (echo "No gid for frrvty in ${GROUPFILE}" && /bin/false)
-chown -R ${frruid}:${frrgid} /etc/frr
+chown ${frruid}:${frrgid} /etc/frr
+chown ${frruid}:${frrgid} /etc/frr/*
touch /etc/frr/vtysh.conf
chgrp ${frrvtygid} /etc/frr/vtysh*
chmod 644 /etc/frr/*
diff --git a/debianpkg/frr.preinst b/debianpkg/frr.preinst
index 467bea971..477e690d0 100644
--- a/debianpkg/frr.preinst
+++ b/debianpkg/frr.preinst
@@ -39,14 +39,16 @@ if [ "$1" = "install" ]; then
# Logfiles are group readable in case users were put into the frr group.
d=/var/log/frr/
mkdir -p $d
- chown -R frr:frr $d
+ chown frr:frr $d
+ chown --quiet frr:frr $d/* | true
chmod u=rwx,go=rx $d
find $d -type f -print0 | xargs -0 --no-run-if-empty chmod u=rw,g=r,o=
# Strict permissions for the sockets.
d=/var/run/frr/
mkdir -p $d
- chown -R frr:frr $d
+ chown frr:frr $d
+ chown --quiet frr:frr $d/* | true
chmod u=rwx,go=rx $d
find $d -type f -print0 | xargs -0 --no-run-if-empty chmod u=rw,go=