diff options
author | beech <beech@FreeBSD.org> | 2008-12-22 16:24:42 +0800 |
---|---|---|
committer | beech <beech@FreeBSD.org> | 2008-12-22 16:24:42 +0800 |
commit | 2887ed17301e295b42b92902d29610073e168b13 (patch) | |
tree | a097dc50de8f483271acc7da50f8755aed1f1e0f /net | |
parent | c75984e99467b3aafbf8a587603548d70cd31ee9 (diff) | |
download | freebsd-ports-gnome-2887ed17301e295b42b92902d29610073e168b13.tar.gz freebsd-ports-gnome-2887ed17301e295b42b92902d29610073e168b13.tar.zst freebsd-ports-gnome-2887ed17301e295b42b92902d29610073e168b13.zip |
The FreeRADIUS Client is a framework and library for writing RADIUS
Clients which additionally includes radlogin, a flexible RADIUS aware
login replacement, a command line program to send RADIUS
authentication/authorisation requests and accounting records and a
utility to query the status of a RADIUS server. All these programs are
based on a library which lets you develop a RADIUS-aware application in
less than 50 lines of C code. It is highly portable and runs on Linux,
many BSD variants and Solaris.
PR: ports/129250
Submitted by: netch at netch.kiev.ua
Diffstat (limited to 'net')
-rw-r--r-- | net/Makefile | 1 | ||||
-rw-r--r-- | net/freeradius-client/Makefile | 25 | ||||
-rw-r--r-- | net/freeradius-client/distinfo | 3 | ||||
-rw-r--r-- | net/freeradius-client/files/patch-configure | 79 | ||||
-rw-r--r-- | net/freeradius-client/files/patch-configure.in | 17 | ||||
-rw-r--r-- | net/freeradius-client/files/patch-lib::config.c | 55 | ||||
-rw-r--r-- | net/freeradius-client/files/patch-lib::ip_util.c | 39 | ||||
-rw-r--r-- | net/freeradius-client/files/patch-lib::options.h | 10 | ||||
-rw-r--r-- | net/freeradius-client/files/patch-lib::sendserver.c | 20 | ||||
-rw-r--r-- | net/freeradius-client/pkg-descr | 10 | ||||
-rw-r--r-- | net/freeradius-client/pkg-plist | 22 |
11 files changed, 281 insertions, 0 deletions
diff --git a/net/Makefile b/net/Makefile index 0db639e96291..7765ed0587d1 100644 --- a/net/Makefile +++ b/net/Makefile @@ -147,6 +147,7 @@ SUBDIR += freenet6 SUBDIR += freenx SUBDIR += freeradius + SUBDIR += freeradius-client SUBDIR += freeradius-mysql SUBDIR += freeradius2 SUBDIR += freevrrpd diff --git a/net/freeradius-client/Makefile b/net/freeradius-client/Makefile new file mode 100644 index 000000000000..17d75dcd1409 --- /dev/null +++ b/net/freeradius-client/Makefile @@ -0,0 +1,25 @@ +# New ports collection makefile for: freeradius-client +# Date created: Wed Nov 26 18:14:37 EET 2008 +# Whom: netch@netch.kiev.ua +# +# $FreeBSD$ +# + +PORTNAME= freeradius-client +PORTVERSION= 1.1.6 +CATEGORIES= net +MASTER_SITES= ftp://ftp.freeradius.org/pub/freeradius/ \ + ftp://ftp.suntel.com.tr/pub/freeradius/ + +MAINTAINER= netch@portaone.com +COMMENT= Client library and basic utilities for RADIUS AAA + +USE_BZIP2= yes +USE_GMAKE= yes +GNU_CONFIGURE= yes +USE_AUTOTOOLS= libtool:15 +USE_LDCONFIG= yes + +CONFLICTS= radiusclient-ng-[0-9]* + +.include <bsd.port.mk> diff --git a/net/freeradius-client/distinfo b/net/freeradius-client/distinfo new file mode 100644 index 000000000000..fc394f6f8c7b --- /dev/null +++ b/net/freeradius-client/distinfo @@ -0,0 +1,3 @@ +MD5 (freeradius-client-1.1.6.tar.bz2) = 2e46564e450ae13aedb70dc133b158ac +SHA256 (freeradius-client-1.1.6.tar.bz2) = a3c9522ed6d9bc795794595a8f3eebada868ea11a0c046637500faf257f9688f +SIZE (freeradius-client-1.1.6.tar.bz2) = 297916 diff --git a/net/freeradius-client/files/patch-configure b/net/freeradius-client/files/patch-configure new file mode 100644 index 000000000000..9df8947bb06b --- /dev/null +++ b/net/freeradius-client/files/patch-configure @@ -0,0 +1,79 @@ +--- configure ++++ configure +@@ -1632,10 +1632,10 @@ + + # The aliases save the names the user supplied, while $host etc. + # will get canonicalized. +-test -n "$target_alias" && +- test "$program_prefix$program_suffix$program_transform_name" = \ +- NONENONEs,x,x, && +- program_prefix=${target_alias}- ++#test -n "$target_alias" && ++# test "$program_prefix$program_suffix$program_transform_name" = \ ++# NONENONEs,x,x, && ++# program_prefix=${target_alias}- + + case "$target" in + *) +@@ -1767,11 +1767,11 @@ + fi + echo "$as_me:$LINENO: result: yes" >&5 + echo "${ECHO_T}yes" >&6 +-test "$program_prefix" != NONE && +- program_transform_name="s,^,$program_prefix,;$program_transform_name" ++#test "$program_prefix" != NONE && ++# program_transform_name="s,^,$program_prefix,;$program_transform_name" + # Use a double $ so make ignores it. +-test "$program_suffix" != NONE && +- program_transform_name="s,\$,$program_suffix,;$program_transform_name" ++#test "$program_suffix" != NONE && ++# program_transform_name="s,\$,$program_suffix,;$program_transform_name" + # Double any \ or $. echo might interpret backslashes. + # By default was `s,x,x', remove it if useless. + cat <<\_ACEOF >conftest.sed +@@ -9911,13 +9911,6 @@ + ;; + esac + +- if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null +- then +- { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 +-echo "$as_me: error: tag name \"$tagname\" already exists" >&2;} +- { (exit 1); exit 1; }; } +- fi +- + # Update the list of available tags. + if test -n "$tagname"; then + echo appending configuration tag \"$tagname\" to $ofile +@@ -18646,6 +18639,7 @@ + + # This can be used to rebuild libtool when needed + LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" ++$ac_aux_dir/ltconfig $LIBTOOL_DEPS + + # Always use our own libtool. + LIBTOOL='$(SHELL) $(top_builddir)/libtool' +@@ -19728,23 +19722,6 @@ + gethostbyaddrrstyle="" + echo "$as_me:$LINENO: checking gethostbyaddr_r() syntax" >&5 + echo $ECHO_N "checking gethostbyaddr_r() syntax... $ECHO_C" >&6 +-case "$host" in +-*-freebsd*) +- +-cat >>confdefs.h <<\_ACEOF +-#define GETHOSTBYADDR_R +-_ACEOF +- +- +-cat >>confdefs.h <<\_ACEOF +-#define GETHOSTBYADDRRSTYLE_BSD +-_ACEOF +- +- gethostbyaddrrstyle=BSD +- { echo "$as_me:$LINENO: WARNING: FreeBSD overridden to BSD-style" >&5 +-echo "$as_me: WARNING: FreeBSD overridden to BSD-style" >&2;} +- ;; +-esac + if test "x$gethostbyaddrrstyle" = "x"; then + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ diff --git a/net/freeradius-client/files/patch-configure.in b/net/freeradius-client/files/patch-configure.in new file mode 100644 index 000000000000..8bae89febb8d --- /dev/null +++ b/net/freeradius-client/files/patch-configure.in @@ -0,0 +1,17 @@ +--- configure.in ++++ configure.in +@@ -66,14 +66,6 @@ + dnl We need #stdio.h to define NULL on FreeBSD (at least) + gethostbyaddrrstyle="" + AC_MSG_CHECKING([gethostbyaddr_r() syntax]) +-case "$host" in +-*-freebsd*) +- AC_DEFINE([GETHOSTBYADDR_R], [], [Define to 1 us gethostbyaddr_r()]) +- AC_DEFINE([GETHOSTBYADDRRSTYLE_BSD], [], [Define to 1 to use bsd-style gethostbyaddr_r()]) +- gethostbyaddrrstyle=BSD +- AC_MSG_WARN([FreeBSD overridden to BSD-style]) +- ;; +-esac + if test "x$gethostbyaddrrstyle" = "x"; then + AC_TRY_LINK([ + #include <stdio.h> diff --git a/net/freeradius-client/files/patch-lib::config.c b/net/freeradius-client/files/patch-lib::config.c new file mode 100644 index 000000000000..337918e4c654 --- /dev/null +++ b/net/freeradius-client/files/patch-lib::config.c @@ -0,0 +1,55 @@ +--- lib/config.c ++++ lib/config.c +@@ -106,7 +106,7 @@ + serv = (SERVER *) option->val; + if (serv == NULL) { + DEBUG(LOG_ERR, "option->val / server is NULL, allocating memory"); +- serv = malloc(sizeof(*serv)); ++ serv = calloc(1, sizeof(*serv)); + if (serv == NULL) { + rc_log(LOG_CRIT, "read_config: out of memory"); + free(p_dupe); +@@ -313,8 +313,8 @@ + + authservers = rc_conf_srv(rh, "authserver"); + acctservers = rc_conf_srv(rh, "acctserver"); +- authservers = malloc(sizeof(SERVER)); +- acctservers = malloc(sizeof(SERVER)); ++ authservers = calloc(1, sizeof(SERVER)); ++ acctservers = calloc(1, sizeof(SERVER)); + + if(authservers == NULL || acctservers == NULL) + { +@@ -491,7 +491,7 @@ + option = find_option(rh, optname, OT_INT|OT_AUO); + + if (option != NULL) { +- return *((int *)option->val); ++ return option->val ? *((int *)option->val) : 0; + } else { + rc_log(LOG_CRIT, "rc_conf_int: unkown config option requested: %s", optname); + abort(); +@@ -528,17 +528,21 @@ + struct stat st; + char *file; + #endif ++ SERVER *srv = NULL; + +- if (!(rc_conf_srv(rh, "authserver")->max)) ++ srv = rc_conf_srv(rh, "authserver"); ++ if (!srv || !srv->max) + { + rc_log(LOG_ERR,"%s: no authserver specified", filename); + return -1; + } +- if (!(rc_conf_srv(rh, "acctserver")->max)) ++ srv = rc_conf_srv(rh, "acctserver"); ++ if (!srv || !srv->max) + { + rc_log(LOG_ERR,"%s: no acctserver specified", filename); + return -1; + } ++ + if (!rc_conf_str(rh, "servers")) + { + rc_log(LOG_ERR,"%s: no servers file specified", filename); diff --git a/net/freeradius-client/files/patch-lib::ip_util.c b/net/freeradius-client/files/patch-lib::ip_util.c new file mode 100644 index 000000000000..657b540fbe95 --- /dev/null +++ b/net/freeradius-client/files/patch-lib::ip_util.c @@ -0,0 +1,39 @@ +--- lib/ip_util.c ++++ lib/ip_util.c +@@ -350,6 +350,36 @@ + } + + /* ++ * Function: rc_nasaddress ++ * ++ * Purpose: get the IP address to be declared as NAS-Address ++ * for sending requests in host order ++ * ++ * Returns: IP address, or 0 if didn't specified ++ * ++ */ ++ ++uint32_t rc_nasaddress(rc_handle *rh) ++{ ++ const char *cs; ++ char hostname[256]; ++ uint32_t rval; ++ ++ cs = rc_conf_str(rh, "nasaddr"); ++ if (cs == NULL || 0 == strcmp(cs, "*")) ++ return 0; ++ ++ strncpy(hostname, cs, sizeof(hostname)); ++ hostname[sizeof(hostname) - 1] = '\0'; ++ if ((rval = rc_get_ipaddr(hostname)) == 0) { ++ rc_log(LOG_ERR, "rc_own_ipaddress: couldn't get IP address from bindaddr"); ++ rval = INADDR_ANY; ++ } ++ ++ return rval; ++} ++ ++/* + * Function: rc_get_srcaddr + * + * Purpose: given remote address find local address which the diff --git a/net/freeradius-client/files/patch-lib::options.h b/net/freeradius-client/files/patch-lib::options.h new file mode 100644 index 000000000000..5d2f000fc16c --- /dev/null +++ b/net/freeradius-client/files/patch-lib::options.h @@ -0,0 +1,10 @@ +--- lib/options.h ++++ lib/options.h +@@ -50,6 +50,7 @@ + {"radius_retries", OT_INT, ST_UNDEF, NULL}, + {"radius_deadtime", OT_INT, ST_UNDEF, NULL}, + {"bindaddr", OT_STR, ST_UNDEF, NULL}, ++{"nasaddr", OT_STR, ST_UNDEF, NULL}, + /* local options */ + {"login_local", OT_STR, ST_UNDEF, NULL}, + }; diff --git a/net/freeradius-client/files/patch-lib::sendserver.c b/net/freeradius-client/files/patch-lib::sendserver.c new file mode 100644 index 000000000000..5d47a599a085 --- /dev/null +++ b/net/freeradius-client/files/patch-lib::sendserver.c @@ -0,0 +1,20 @@ +--- lib/sendserver.c ++++ lib/sendserver.c +@@ -196,6 +196,7 @@ + char send_buffer[BUFFER_LEN]; + int retries; + VALUE_PAIR *vp; ++ unsigned long nasaddr; + + server_name = data->server; + if (server_name == NULL || server_name[0] == '\0') +@@ -259,6 +262,9 @@ + /* + * Fill in NAS-IP-Address + */ ++ nas_ipaddr = rc_nasaddress(rh); ++ if (nas_ipaddr != 0) ++ sinlocal.sin_addr.s_addr = htonl(nas_ipaddr); + if (sinlocal.sin_addr.s_addr == htonl(INADDR_ANY)) { + if (rc_get_srcaddr(SA(&sinlocal), SA(&sinremote)) != 0) { + close (sockfd); diff --git a/net/freeradius-client/pkg-descr b/net/freeradius-client/pkg-descr new file mode 100644 index 000000000000..b354e9ff3a35 --- /dev/null +++ b/net/freeradius-client/pkg-descr @@ -0,0 +1,10 @@ +The FreeRADIUS Client is a framework and library for writing RADIUS +Clients which additionally includes radlogin, a flexible RADIUS aware +login replacement, a command line program to send RADIUS +authentication/authorisation requests and accounting records and a +utility to query the status of a RADIUS server. All these programs are +based on a library which lets you develop a RADIUS-aware application in +less than 50 lines of C code. It is highly portable and runs on Linux, +many BSD variants and Solaris. + +WWW: http://wiki.freeradius.org/Radiusclient diff --git a/net/freeradius-client/pkg-plist b/net/freeradius-client/pkg-plist new file mode 100644 index 000000000000..5e49cacfa71d --- /dev/null +++ b/net/freeradius-client/pkg-plist @@ -0,0 +1,22 @@ +etc/radiusclient/dictionary +etc/radiusclient/dictionary.ascend +etc/radiusclient/dictionary.compat +etc/radiusclient/dictionary.merit +etc/radiusclient/dictionary.sip +etc/radiusclient/issue +etc/radiusclient/port-id-map +etc/radiusclient/radiusclient.conf +etc/radiusclient/servers +include/freeradius-client.h +lib/libfreeradius-client.a +lib/libfreeradius-client.la +lib/libfreeradius-client.so +lib/libfreeradius-client.so.2 +sbin/login.radius +sbin/radacct +sbin/radembedded +sbin/radexample +sbin/radiusclient +sbin/radlogin +sbin/radstatus +@dirrm etc/radiusclient |