From 25b3404069ea653ca15841fecfed4e1f1bdf82a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= Date: Thu, 31 Jul 2014 14:09:44 +0200 Subject: [PATCH] radsecproxy: add package MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Toke Høiland-Jørgensen --- net/radsecproxy/Makefile | 57 ++++++++++++++++++ net/radsecproxy/files/radsecproxy.init | 16 +++++ .../patches/100-missing-return.patch | 58 +++++++++++++++++++ .../patches/200-logdest-on-foreground.patch | 31 ++++++++++ 4 files changed, 162 insertions(+) create mode 100644 net/radsecproxy/Makefile create mode 100644 net/radsecproxy/files/radsecproxy.init create mode 100644 net/radsecproxy/patches/100-missing-return.patch create mode 100644 net/radsecproxy/patches/200-logdest-on-foreground.patch diff --git a/net/radsecproxy/Makefile b/net/radsecproxy/Makefile new file mode 100644 index 0000000000..b36503aa1c --- /dev/null +++ b/net/radsecproxy/Makefile @@ -0,0 +1,57 @@ +# +# Copyright (C) 2008-2012 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=radsecproxy +PKG_VERSION:=1.6.5 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://software.uninett.no/radsecproxy/ +PKG_MD5SUM:=f74f82a7ae2cdf2b1d9d271a5c360617 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/radsecproxy + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libopenssl +libpthread + TITLE:=radsecproxy + URL:=http://software.uninett.no/radsecproxy + MAINTAINER:=Toke Høiland-Jørgensen +endef + +define Package/radsecproxy/description + A generic radius proxy for UDP/TLS (RadSec) +endef + +CONFIGURE_ARGS+= \ + --with-ssl="$(STAGING_DIR)/usr" + +#TARGET_CFLAGS += -ansi +#TARGET_CFLAGS += -std=c99 +TARGET_CFLAGS += -Wno-long-long + + +define Package/radsecproxy/install + $(INSTALL_DIR) $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/radsecproxy $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/ + $(CP) $(PKG_BUILD_DIR)/radsecproxy.conf-example $(1)/etc/radsecproxy.conf + $(INSTALL_DIR) $(1)/etc/init.d/ + $(INSTALL_BIN) ./files/radsecproxy.init $(1)/etc/init.d/radsecproxy +endef + +define Package/radsecproxy/conffiles +/etc/radsecproxy.conf +endef + +$(eval $(call BuildPackage,radsecproxy)) + diff --git a/net/radsecproxy/files/radsecproxy.init b/net/radsecproxy/files/radsecproxy.init new file mode 100644 index 0000000000..39bdc6e4ba --- /dev/null +++ b/net/radsecproxy/files/radsecproxy.init @@ -0,0 +1,16 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=70 + +USE_PROCD=1 +PROG=/usr/sbin/radsecproxy +CONFFILE=/etc/radsecproxy.conf + +start_service() { + procd_open_instance + procd_set_param command $PROG -f -c $CONFFILE + procd_set_param file $CONFFILE + procd_set_param respawn + procd_close_instance +} diff --git a/net/radsecproxy/patches/100-missing-return.patch b/net/radsecproxy/patches/100-missing-return.patch new file mode 100644 index 0000000000..871fc6e104 --- /dev/null +++ b/net/radsecproxy/patches/100-missing-return.patch @@ -0,0 +1,58 @@ +--- a/dtls.c ++++ b/dtls.c +@@ -523,6 +523,7 @@ void *udpdtlsserverrd(void *arg) { + free(params); + cacheexpire(sessioncache, &lastexpiry); + } ++ return NULL; + } + + int dtlsconnect(struct server *server, struct timeval *when, int timeout, char *text) { +@@ -642,6 +643,7 @@ void *udpdtlsclientrd(void *arg) { + if (udp2bio(s, conf->servers->rbios, cnt)) + debug(DBG_DBG, "radudpget: got DTLS in UDP from %s", addr2string((struct sockaddr *)&from)); + } ++ return NULL; + } + + void *dtlsclientrd(void *arg) { +--- a/radsecproxy.c ++++ b/radsecproxy.c +@@ -3203,6 +3203,8 @@ void *sighandler(void *arg) { + debug(DBG_WARN, "sighandler: ignoring signal %d", sig); + } + } ++ ++ return NULL; + } + + int createpidfile(const char *pidfile) { +@@ -3289,6 +3291,8 @@ int radsecproxy_main(int argc, char **ar + /* just hang around doing nothing, anything to do here? */ + for (;;) + sleep(1000); ++ ++ return 0; + } + + /* Local Variables: */ +--- a/udp.c ++++ b/udp.c +@@ -266,6 +266,8 @@ void *udpclientrd(void *arg) { + buf = radudpget(*s, NULL, &server, NULL); + replyh(server, buf); + } ++ ++ return NULL; + } + + void *udpserverrd(void *arg) { +@@ -310,6 +312,8 @@ void *udpserverwr(void *arg) { + debug(DBG_DBG, "udpserverwr: refcount %d", reply->refcount); + freerq(reply); + } ++ ++ return NULL; + } + + void addclientudp(struct client *client) { diff --git a/net/radsecproxy/patches/200-logdest-on-foreground.patch b/net/radsecproxy/patches/200-logdest-on-foreground.patch new file mode 100644 index 0000000000..6678448acf --- /dev/null +++ b/net/radsecproxy/patches/200-logdest-on-foreground.patch @@ -0,0 +1,31 @@ +diff --git a/radsecproxy.c b/radsecproxy.c +index 563c4a8..9fa076d 100644 +--- a/radsecproxy.c ++++ b/radsecproxy.c +@@ -3382,18 +3382,16 @@ int radsecproxy_main(int argc, char **argv) { + options.loglevel = loglevel; + else if (options.loglevel) + debug_set_level(options.loglevel); +- if (!foreground) { +- debug_set_destination(options.logdestination +- ? options.logdestination +- : "x-syslog:///", LOG_TYPE_DEBUG); ++ debug_set_destination(options.logdestination ++ ? options.logdestination ++ : "x-syslog:///", LOG_TYPE_DEBUG); + #if defined(WANT_FTICKS) +- if (options.ftickssyslogfacility) { +- debug_set_destination(options.ftickssyslogfacility, +- LOG_TYPE_FTICKS); +- free(options.ftickssyslogfacility); +- } +-#endif ++ if (options.ftickssyslogfacility) { ++ debug_set_destination(options.ftickssyslogfacility, ++ LOG_TYPE_FTICKS); ++ free(options.ftickssyslogfacility); + } ++#endif + free(options.logdestination); + + if (!list_first(clconfs))