summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--net/kamailio/Makefile2
-rw-r--r--net/kamailio/patches/100-kamcmd-don-t-clash-with-ENV-NAME-or-ctl.so-module.patch45
2 files changed, 46 insertions, 1 deletions
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 <ansuelsmth@gmail.com>
+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 <ansuelsmth@gmail.com>
+---
+ 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