xinetd: support for anonym configs
authorFritz D. Ansel <fdansel@yandex.ru>
Thu, 12 Aug 2021 12:01:48 +0000 (14:01 +0200)
committerFritz D. Ansel <fdansel@yandex.ru>
Thu, 12 Aug 2021 12:01:48 +0000 (14:01 +0200)
config by names clashes if a service supports
udp and tcp, eg time and daytime

Signed-off-by: Fritz D. Ansel <fdansel@yandex.ru>
net/xinetd/Makefile
net/xinetd/files/xinetd.init

index ef44d93cee9b2bf9bedc26d109ee2feff9158ef9..99b576121d9fd7144f2a240f9d7c602b709fea70 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=xinetd
 PKG_VERSION:=2.3.15
-PKG_RELEASE:=11
+PKG_RELEASE:=12
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://github.com/xinetd-org/xinetd/archive
index bfc9b318d664a9615d465a439a2e3972f3cc9b3e..699d6fa5830a41a97a9a2425e93ab364db3d6196 100644 (file)
@@ -43,7 +43,7 @@ config_cb() {
        fi
 
        local type="$1"
-       local name="$2"
+       local name="$(uci -q get xinetd.$2.name || echo $2)"
 
        if [ "$type" = "service" ]; then
 
@@ -62,7 +62,7 @@ config_cb() {
                        local option="$1"
                        local value="$2"
 
-                       [ -n "$value" ] && echo -e "\t$option = $value" >> $GENERATED_CONF_FILE
+                       [ -n "$value" ] && [ "$option" != "name" ] && echo -e "\t$option = $value" >> $GENERATED_CONF_FILE
                }
 
                # redefined callback for lists when calling config_load