From: Christian Marangi Date: Fri, 3 Nov 2023 02:33:16 +0000 (+0100) Subject: kamailio: add patch fixing fragile kamcmd X-Git-Url: http://git.openwrt.org/?a=commitdiff_plain;h=ceb721c048318da11d39b0388cd835584aec9dc5;hp=5f998af5ee77cbc869ada3921dd6d2e5966b58e4;p=feed%2Ftelephony.git kamailio: add patch fixing fragile kamcmd Add patch fixing fragile kamcmd where output bin can be renamed to invalid names due to ENV variable clash. Signed-off-by: Christian Marangi --- diff --git a/net/kamailio/Makefile b/net/kamailio/Makefile index e750201..cea0c6a 100644 --- a/net/kamailio/Makefile +++ b/net/kamailio/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=kamailio PKG_VERSION:=5.6.2 -PKG_RELEASE:=4 +PKG_RELEASE:=5 PKG_SOURCE_URL:=https://www.kamailio.org/pub/kamailio/$(PKG_VERSION)/src PKG_SOURCE:=kamailio-$(PKG_VERSION)_src.tar.gz diff --git a/net/kamailio/patches/100-kamcmd-don-t-clash-with-ENV-NAME-or-ctl.so-module.patch b/net/kamailio/patches/100-kamcmd-don-t-clash-with-ENV-NAME-or-ctl.so-module.patch new file mode 100644 index 0000000..893cf6a --- /dev/null +++ b/net/kamailio/patches/100-kamcmd-don-t-clash-with-ENV-NAME-or-ctl.so-module.patch @@ -0,0 +1,45 @@ +From 8421e2be8331a03b0087eb33241fac98e1fd821f Mon Sep 17 00:00:00 2001 +From: Christian Marangi +Date: Fri, 3 Nov 2023 03:09:21 +0100 +Subject: [PATCH] kamcmd: don't clash with ENV NAME or ctl.so module + +NAME variable might be set to the current HOSTNAME in some shell and +also clash with the value set by the module calling MOD_INSTALL_UTILS by +passing a NAME variable. + +With commit 1774cee62098 ("kamcmd: allow defining the name of the +application from command line") this resulted in the kamcmd bin being +renamed to all kind of name from hostname to ctl.so. + +Fix this by checking the variable to a more safe name that is not +already defined in shell by default and also that doesn't clash with +module variables, use UTIL_NAME as an alternative to NAME. + +UTIL_NAME now needs to be used to create kamcmd with custom name. + +Fixes: 1774cee62098 ("kamcmd: allow defining the name of the application from command line") +Signed-off-by: Christian Marangi +--- + utils/kamcmd/Makefile | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +--- a/utils/kamcmd/Makefile ++++ b/utils/kamcmd/Makefile +@@ -8,10 +8,15 @@ include $(COREPATH)/Makefile.targets + auto_gen= + RELEASE=1.5 + UTIL_SRC_NAME=kamcmd ++# Pass CUSTOM_NAME to overwrite the kamcmd/sercmd bin name ++ifeq ($(CUSTOM_NAME),) + ifeq ($(FLAVOUR),ser) +- NAME?=sercmd ++ NAME=sercmd + else +- NAME?=kamcmd ++ NAME=kamcmd ++endif ++else ++ NAME=$(CUSTOM_NAME) + endif + + readline_localpath=$(LOCALBASE)/include/readline/readline.h