frr: Set configuration file permissions correctly
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 30 Oct 2018 17:32:48 +0000 (17:32 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 30 Oct 2018 17:32:48 +0000 (17:32 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/initscripts/packages/frr

index 9ebb5f8..5fa4e9f 100755 (executable)
@@ -13,8 +13,17 @@ DAEMONS="zebra bgpd ospfd staticd"
 
 case "${1}" in
        start)
+               # Fix permissions of configuration directory
+               if [ -d "/etc/frr" ]; then
+                       chown root.frr /etc/frr
+                       chmod 775 /etc/frr
+               fi
+
                for daemon in ${DAEMONS}; do
                        if [ -f "/etc/frr/${daemon}.conf" ]; then
+                               # Set permissions
+                               chown frr.frr "/etc/frr/${daemon}.conf"
+
                                boot_mesg "Starting FRRouting ${daemon}..."
                                loadproc "/usr/sbin/${daemon}" --daemon
                        fi