keepalived: add script security param to fix warning
authorFlorian Eckert <fe@dev.tdt.de>
Wed, 29 Apr 2020 17:40:46 +0000 (19:40 +0200)
committerFlorian Eckert <Eckert.Florian@googlemail.com>
Mon, 4 May 2020 07:07:00 +0000 (09:07 +0200)
Openwrt is a single user system. So keepalived is runnig as root.
If we add the config options `script_user root` and
`enabled_script_security' the following warnings are gone.

> local1.info Keepalived_vrrp[5382]: SECURITY VIOLATION - scripts are
being executed but script_security not enabled.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
net/keepalived/files/keepalived.init

index 05c47bb36909f2f5d9b3062db7868fb0fcc9e800..7af3f9c613a6051cef466119cdce08d625145af6 100644 (file)
@@ -98,6 +98,9 @@ print_notify() {
 globals() {
        local notification_email
 
+       printf '%bscript_user root\n' "${INDENT_1}" >> "$KEEPALIVED_CONF"
+       printf '%benabled_script_security\n' "${INDENT_1}" >> "$KEEPALIVED_CONF"
+
        config_get notification_email "$1" notification_email
        print_list_indent notification_email