Skip to contentSkip to conversation

freeradius: add new recipe

PATCH New [email protected] 1 participant 2 messages May 10, 2017

lore
Share & tools
lore
#0 lore raw

v3 cover freeradius: add new recipe

From: Jackie Huang <[email protected]>

v3 comments:
update to the latest version 3.0.13

---
The following changes since commit 6418010bf0d74b21247962edbc63dd5e6fb1069a:

ninja: extend to nativesdk (2017-05-04 09:18:58 +0200)

are available in the git repository at:

git://git.pokylinux.org/poky-contrib.git jhuang0/r_upstream-freeradius-v3_170510_0
http://git.pokylinux.org/cgit.cgi//log/?h=jhuang0/r_upstream-freeradius-v3_170510_0

Jackie Huang (1):
freeradius: add new recipe

 .../freeradius/files/freeradius                    | 110 ++++++++++
 .../freeradius-avoid-searching-host-dirs.patch     | 197 +++++++++++++++++
 ...radius-configure.ac-add-option-for-libcap.patch |  70 ++++++
 ...dius-configure.ac-allow-cross-compilation.patch |  31 +++
 .../files/freeradius-enble-user-in-conf.patch      |  28 +++
 ...eeradius-fix-error-for-expansion-of-macro.patch |  61 ++++++
 ...ius-fix-issues-related-to-m4-include-path.patch | 236 +++++++++++++++++++++
 .../freeradius-fix-quoting-for-BUILT_WITH.patch    |  55 +++++
 .../files/freeradius-libtool-detection.patch       |  89 ++++++++
 .../freeradius-libtool-do-not-use-jlibtool.patch   | 160 ++++++++++++++
 .../freeradius-rlm_python-add-PY_INC_DIR.patch     |  33 +++
 .../freeradius/files/radiusd-volatiles.conf        |   2 +
 .../freeradius/files/radiusd.service               |  16 ++
 .../freeradius/files/volatiles.58_radiusd          |   3 +
 .../freeradius/freeradius_3.0.13.bb                | 223 +++++++++++++++++++
 15 files changed, 1314 insertions(+)
 create mode 100644 meta-networking/recipes-connectivity/freeradius/files/freeradius
 create mode 100644 meta-networking/recipes-connectivity/freeradius/files/freeradius-avoid-searching-host-dirs.patch
 create mode 100644 meta-networking/recipes-connectivity/freeradius/files/freeradius-configure.ac-add-option-for-libcap.patch
 create mode 100644 meta-networking/recipes-connectivity/freeradius/files/freeradius-configure.ac-allow-cross-compilation.patch
 create mode 100644 meta-networking/recipes-connectivity/freeradius/files/freeradius-enble-user-in-conf.patch
 create mode 100644 meta-networking/recipes-connectivity/freeradius/files/freeradius-fix-error-for-expansion-of-macro.patch
 create mode 100644 meta-networking/recipes-connectivity/freeradius/files/freeradius-fix-issues-related-to-m4-include-path.patch
 create mode 100644 meta-networking/recipes-connectivity/freeradius/files/freeradius-fix-quoting-for-BUILT_WITH.patch
 create mode 100644 meta-networking/recipes-connectivity/freeradius/files/freeradius-libtool-detection.patch
 create mode 100644 meta-networking/recipes-connectivity/freeradius/files/freeradius-libtool-do-not-use-jlibtool.patch
 create mode 100644 meta-networking/recipes-connectivity/freeradius/files/freeradius-rlm_python-add-PY_INC_DIR.patch
 create mode 100644 meta-networking/recipes-connectivity/freeradius/files/radiusd-volatiles.conf
 create mode 100644 meta-networking/recipes-connectivity/freeradius/files/radiusd.service
 create mode 100644 meta-networking/recipes-connectivity/freeradius/files/volatiles.58_radiusd
 create mode 100644 meta-networking/recipes-connectivity/freeradius/freeradius_3.0.13.bb
Signature · 1 line
2.11.0
#1 lore raw

PATCH v3 1/1 freeradius: add new recipe

From: Jackie Huang <[email protected]>

FreeRADIUS is an Internet authentication daemon,
which implements the RADIUS protocol, as defined
in RFC 2865 (and others).

---
 .../freeradius/files/freeradius                    | 110 ++++++++++
 .../freeradius-avoid-searching-host-dirs.patch     | 197 +++++++++++++++++
 ...radius-configure.ac-add-option-for-libcap.patch |  70 ++++++
 ...dius-configure.ac-allow-cross-compilation.patch |  31 +++
 .../files/freeradius-enble-user-in-conf.patch      |  28 +++
 ...eeradius-fix-error-for-expansion-of-macro.patch |  61 ++++++
 ...ius-fix-issues-related-to-m4-include-path.patch | 236 +++++++++++++++++++++
 .../freeradius-fix-quoting-for-BUILT_WITH.patch    |  55 +++++
 .../files/freeradius-libtool-detection.patch       |  89 ++++++++
 .../freeradius-libtool-do-not-use-jlibtool.patch   | 160 ++++++++++++++
 .../freeradius-rlm_python-add-PY_INC_DIR.patch     |  33 +++
 .../freeradius/files/radiusd-volatiles.conf        |   2 +
 .../freeradius/files/radiusd.service               |  16 ++
 .../freeradius/files/volatiles.58_radiusd          |   3 +
 .../freeradius/freeradius_3.0.13.bb                | 223 +++++++++++++++++++
 15 files changed, 1314 insertions(+)
 create mode 100644 meta-networking/recipes-connectivity/freeradius/files/freeradius
 create mode 100644 meta-networking/recipes-connectivity/freeradius/files/freeradius-avoid-searching-host-dirs.patch
 create mode 100644 meta-networking/recipes-connectivity/freeradius/files/freeradius-configure.ac-add-option-for-libcap.patch
 create mode 100644 meta-networking/recipes-connectivity/freeradius/files/freeradius-configure.ac-allow-cross-compilation.patch
 create mode 100644 meta-networking/recipes-connectivity/freeradius/files/freeradius-enble-user-in-conf.patch
 create mode 100644 meta-networking/recipes-connectivity/freeradius/files/freeradius-fix-error-for-expansion-of-macro.patch
 create mode 100644 meta-networking/recipes-connectivity/freeradius/files/freeradius-fix-issues-related-to-m4-include-path.patch
 create mode 100644 meta-networking/recipes-connectivity/freeradius/files/freeradius-fix-quoting-for-BUILT_WITH.patch
 create mode 100644 meta-networking/recipes-connectivity/freeradius/files/freeradius-libtool-detection.patch
 create mode 100644 meta-networking/recipes-connectivity/freeradius/files/freeradius-libtool-do-not-use-jlibtool.patch
 create mode 100644 meta-networking/recipes-connectivity/freeradius/files/freeradius-rlm_python-add-PY_INC_DIR.patch
 create mode 100644 meta-networking/recipes-connectivity/freeradius/files/radiusd-volatiles.conf
 create mode 100644 meta-networking/recipes-connectivity/freeradius/files/radiusd.service
 create mode 100644 meta-networking/recipes-connectivity/freeradius/files/volatiles.58_radiusd
 create mode 100644 meta-networking/recipes-connectivity/freeradius/freeradius_3.0.13.bb
meta-networking/recipes-connectivity/freeradius/files/freeradius new file +110 -0
new file mode 100644
index 000000000..fa412e2aa
@@ -0,0 +1,110 @@
+#!/bin/sh
+# Start/stop the FreeRADIUS daemon.
+
+### BEGIN INIT INFO
+# Provides:          freeradius
+# Required-Start:    $remote_fs $network $syslog
+# Should-Start:      $time mysql slapd postgresql samba krb5-kdc
+# Required-Stop:     $remote_fs $syslog
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Radius Daemon
+# Description:       Extensible, configurable radius daemon
+### END INIT INFO
+
+set -e
+
+# Source function library.
+. /etc/init.d/functions
+
+if [ -f /lib/lsb/init-functions ]; then
+  . /lib/lsb/init-functions
+fi
+
+PROG="radiusd"
+PROGRAM="/usr/sbin/radiusd"
+PIDFILE="/var/run/radiusd/radiusd.pid"
+DESCR="FreeRADIUS daemon"
+
+if [ -r /etc/default/$PROG ]; then
+  . /etc/default/$PROG
+fi
+
+test -f $PROGRAM || exit 0
+
+check_certs() {
+	if [ ! -f /etc/raddb/certs/server.pem ]; then
+		echo -n "Creating certificates for freeradius..."
+		if sudo -u radiusd /etc/raddb/certs/bootstrap 1> /dev/null 2> /dev/null; then
+			echo "done"
+		else
+			echo "failed!"
+		fi
+	fi
+
+}
+
+# /var/run may be a tmpfs
+if [ ! -d /var/run/radiusd ]; then
+  mkdir -p /var/run/radiusd
+  chown radiusd:radiusd /var/run/radiusd
+fi
+
+if [ ! -d /var/log/radius ]; then
+  mkdir -p /var/log/radius
+  touch /var/log/radius/radius.log
+  chown radiusd:radiusd /var/run/radius
+fi
+
+if [ ! -f ${PIDFILE} ]; then
+  touch ${PIDFILE}
+  chown radiusd:radiusd ${PIDFILE}
+fi
+
+export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
+
+ret=0
+
+case "$1" in
+        start)
+		check_certs
+                echo -n "Starting $DESCR" "$PROG"
+                start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $PROGRAM -- $FREERADIUS_OPTIONS || ret=$?
+                [ "$ret" == 0 ] && echo " Success" || echo " Failed"
+                exit $ret
+                ;;
+        stop)
+                echo -n "Stopping $DESCR" "$PROG"
+                if [ -f "$PIDFILE" ] ; then
+                  start-stop-daemon --stop --retry=TERM/30/KILL/5 --quiet --pidfile $PIDFILE || ret=$?
+                else
+                  echo -n "$PIDFILE not found"
+                  ret=1
+                fi
+                [ "$ret" == 0 ] && echo " Success" || echo " Failed"
+                ;;
+        status)
+                status $PROGRAM;
+                exit $?
+                ;;
+        restart)
+                $0 stop
+                $0 start
+                ;;
+        reload|force-reload)
+                echo -n "Reloading $DESCR" "$PROG"
+                if [ -f "$PIDFILE" ] ; then
+                  start-stop-daemon --stop --signal HUP --quiet --pidfile $PIDFILE || ret=$?
+                else
+                  echo -n "$PIDFILE not found"
+                  ret=1
+                fi
+                [ "$ret" == 0 ] && echo " Success" || echo " Failed"
+                ;;
+        *)
+                echo "Usage: $0 start|stop|status|restart|force-reload|reload"
+                exit 1
+                ;;
+esac
+
+exit 0
meta-networking/recipes-connectivity/freeradius/files/freeradius-avoid-searching-host-dirs.patch new file +197 -0

197 lines not on this page · raw message

meta-networking/recipes-connectivity/freeradius/files/freeradius-configure.ac-add-option-for-libcap.patch new file +70 -0

70 lines not on this page · raw message

meta-networking/recipes-connectivity/freeradius/files/freeradius-configure.ac-allow-cross-compilation.patch new file +31 -0
new file mode 100644
index 000000000..30497a602
@@ -0,0 +1,31 @@
+Subject: [PATCH] configure.ac: allow cross-compilation
+
+The checking OpenSSL library and header version consistency will
+always fail in cross compiling, skip the check and give a warning
+instead for cross compiling.
+
+Upstream-Status: Inappropriate[embedded specific]
+
+Signed-off-by: Jackie Huang <[email protected]>
+Signed-off-by: Yi Zhao <[email protected]>
+---
+ src/modules/rlm_krb5/configure.ac | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/modules/rlm_krb5/configure.ac b/src/modules/rlm_krb5/configure.ac
+index eb43534..113a079 100644
+--- a/src/modules/rlm_krb5/configure.ac
++++ b/src/modules/rlm_krb5/configure.ac
+@@ -137,7 +137,8 @@ if test x$with_[]modname != xno; then
+ 		FR_SMART_CHECK_LIB(krb5, krb5_is_thread_safe)
+ 		if test "x$ac_cv_lib_krb5_krb5_is_thread_safe" == xyes; then
+ 			AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include <krb5.h>]], [[return krb5_is_thread_safe() ? 0 : 1]])],
+-				[krb5threadsafe="-DKRB5_IS_THREAD_SAFE"], [AC_MSG_WARN([[libkrb5 is not threadsafe]])])
++				[krb5threadsafe="-DKRB5_IS_THREAD_SAFE"], [AC_MSG_WARN([[libkrb5 is not threadsafe]])],
++				[AC_MSG_WARN(cross compiling: not checking)])
+ 		fi
+ 	else
+ 		krb5threadsafe=""
+-- 
+2.10.2
+
meta-networking/recipes-connectivity/freeradius/files/freeradius-enble-user-in-conf.patch new file +28 -0
new file mode 100644
index 000000000..4a62bf1fa
@@ -0,0 +1,28 @@
+Enable and change user and group of freeradius server to radiusd
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Roy.Li <[email protected]>
+Signed-off-by: Jackie Huang <[email protected]>
+---
+ raddb/radiusd.conf.in | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/raddb/radiusd.conf.in b/raddb/radiusd.conf.in
+index c62f4ff..0b4a84e 100644
+--- a/raddb/radiusd.conf.in
++++ b/raddb/radiusd.conf.in
+@@ -436,8 +436,8 @@ security {
+ 	#  member.  This can allow for some finer-grained access
+ 	#  controls.
+ 	#
+-#	user = radius
+-#	group = radius
++	user = radiusd
++	group = radiusd
+ 
+ 	#  Core dumps are a bad thing.  This should only be set to
+ 	#  'yes' if you're debugging a problem with the server.
+-- 
+1.9.1
+
meta-networking/recipes-connectivity/freeradius/files/freeradius-fix-error-for-expansion-of-macro.patch new file +61 -0

61 lines not on this page · raw message

meta-networking/recipes-connectivity/freeradius/files/freeradius-fix-issues-related-to-m4-include-path.patch new file +236 -0

236 lines not on this page · raw message

meta-networking/recipes-connectivity/freeradius/files/freeradius-fix-quoting-for-BUILT_WITH.patch new file +55 -0

55 lines not on this page · raw message

meta-networking/recipes-connectivity/freeradius/files/freeradius-libtool-detection.patch new file +89 -0

89 lines not on this page · raw message

meta-networking/recipes-connectivity/freeradius/files/freeradius-libtool-do-not-use-jlibtool.patch new file +160 -0

160 lines not on this page · raw message

meta-networking/recipes-connectivity/freeradius/files/freeradius-rlm_python-add-PY_INC_DIR.patch new file +33 -0
new file mode 100644
index 000000000..675940dd6
@@ -0,0 +1,33 @@
+From a0bf65e04d2bbd3271cab94bd5ac93f8e877bfc5 Mon Sep 17 00:00:00 2001
+From: Jackie Huang <[email protected]>
+Date: Wed, 27 Jan 2016 05:07:19 -0500
+Subject: [PATCH] rlm_python: add PY_INC_DIR in search dir
+
+Upstream-Status: Pending
+
+configure option --with-rlm-python-include-dir is used to set
+PY_INC_DIR which is never used and it fails to find Python.h,
+so add it into search dir to fix it.
+
+Signed-off-by: Jackie Huang <[email protected]>
+Signed-off-by: Yi Zhao <[email protected]>
+---
+ src/modules/rlm_python/configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/modules/rlm_python/configure.ac b/src/modules/rlm_python/configure.ac
+index 831a33a..c3792d8 100644
+--- a/src/modules/rlm_python/configure.ac
++++ b/src/modules/rlm_python/configure.ac
+@@ -93,7 +93,7 @@ if test x$with_[]modname != xno; then
+ 
+ 		old_CFLAGS=$CFLAGS
+ 		CFLAGS="$CFLAGS $PY_CFLAGS"
+-		smart_try_dir="$PY_PREFIX/include/python$PY_SYS_VERSION"
++		smart_try_dir="$PY_PREFIX/include/python$PY_SYS_VERSION $PY_INC_DIR"
+ 		FR_SMART_CHECK_INCLUDE(Python.h)
+ 		CFLAGS=$old_CFLAGS
+ 
+-- 
+2.10.2
+
meta-networking/recipes-connectivity/freeradius/files/radiusd-volatiles.conf new file +2 -0
new file mode 100644
index 000000000..fa6296297
@@ -0,0 +1,2 @@
+d /var/log/radius  0755 radiusd radiusd -
+d /var/run/radiusd 0755 radiusd radiusd -
meta-networking/recipes-connectivity/freeradius/files/radiusd.service new file +16 -0
new file mode 100644
index 000000000..899c4e495
@@ -0,0 +1,16 @@
+[Unit]
+Description=FreeRADIUS high performance RADIUS server.
+After=syslog.target network.target
+
+[Service]
+Type=forking
+PIDFile=@STATEDIR@/run/radiusd/radiusd.pid
+ExecStartPre=-@BASE_BINDIR@/chown -R radiusd.radiusd @STATEDIR@/run/radiusd
+ExecStartPre=-@BASE_BINDIR@/sh -c "if [ ! -f @SYSCONFDIR@/raddb/certs/server.pem ]; then sudo -u radiusd @SYSCONFDIR@/raddb/certs/bootstrap; fi"
+ExecStartPre=@SBINDIR@/radiusd -C
+ExecStart=@SBINDIR@/radiusd -d @SYSCONFDIR@/raddb
+ExecReload=@SBINDIR@/radiusd -C
+ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target
meta-networking/recipes-connectivity/freeradius/files/volatiles.58_radiusd new file +3 -0
new file mode 100644
index 000000000..8cbdae8a6
@@ -0,0 +1,3 @@
+# <type> <owner> <group> <mode> <path> <linksource>
+d radiusd radiusd 0755 /var/run/radiusd none
+d radiusd radiusd 0755 /var/log/radius none
meta-networking/recipes-connectivity/freeradius/freeradius_3.0.13.bb new file +223 -0

223 lines not on this page · raw message

Signature · 1 line
2.11.0