freeradius3: fix hostname invocation in radtest 13385/head
authorAlexey Dobrovolsky <dobrovolskiy.alexey@gmail.com>
Sun, 13 Sep 2020 22:36:30 +0000 (01:36 +0300)
committerAlexey Dobrovolsky <dobrovolskiy.alexey@gmail.com>
Sun, 13 Sep 2020 22:36:30 +0000 (01:36 +0300)
Canonical radtest start results in an error:

$ radtest bob hello localhost 0 testing123
/usr/bin/radtest: line 1: hostname: not found
(0) Error parsing "stdin": Failed to get value

hostname command is not present in OpenWrt.
Instead, hostname can be obtained from file /proc/sys/kernel/hostname.

added: 005-get-hostname-from-proc-in-radtest.patch

(backported from commit 8b2792a)
Signed-off-by: Alexey Dobrovolsky <dobrovolskiy.alexey@gmail.com>
net/freeradius3/Makefile
net/freeradius3/patches/005-get-hostname-from-proc-in-radtest.patch [new file with mode: 0644]

index 7ccaed06b63acadd4894d441b7979c129a6c583d..e13e8db874ee8283a267d47b89af96c80f4e9e6e 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=freeradius3
 PKG_VERSION:=release_3_0_21
-PKG_RELEASE:=4
+PKG_RELEASE:=5
 
 PKG_SOURCE:=$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://github.com/FreeRADIUS/freeradius-server/archive
diff --git a/net/freeradius3/patches/005-get-hostname-from-proc-in-radtest.patch b/net/freeradius3/patches/005-get-hostname-from-proc-in-radtest.patch
new file mode 100644 (file)
index 0000000..c3f368e
--- /dev/null
@@ -0,0 +1,12 @@
+--- a/src/main/radtest.in
++++ b/src/main/radtest.in
+@@ -112,7 +112,7 @@ if [ "$7" ]
+ then
+       nas=$7
+ else
+-      nas=`hostname`
++      nas=$(cat /proc/sys/kernel/hostname)
+ fi
+ (
+