From c4017afbcbcf8ec63dfb19ae2ade55facbafa6e3 Mon Sep 17 00:00:00 2001 From: James FitzGibbon Date: Tue, 24 Sep 1996 15:12:01 +0000 Subject: Import of Ascend-modified RADIUS daemon. Reviewed by: chuckr@FreeBSD.ORG --- net/ascend-radius/Makefile | 59 +++++++++++++++++++++ net/ascend-radius/distinfo | 1 + net/ascend-radius/files/patch-aa | 45 ++++++++++++++++ net/ascend-radius/files/patch-ab | 24 +++++++++ net/ascend-radius/files/patch-ac | 29 ++++++++++ net/ascend-radius/files/patch-ad | 34 ++++++++++++ net/ascend-radius/files/patch-ae | 13 +++++ net/ascend-radius/files/patch-af | 96 +++++++++++++++++++++++++++++++++ net/ascend-radius/files/patch-ag | 103 ++++++++++++++++++++++++++++++++++++ net/ascend-radius/pkg-comment | 1 + net/ascend-radius/pkg-descr | 0 net/ascend-radius/pkg-plist | 18 +++++++ net/ascend-radius/scripts/configure | 6 +++ 13 files changed, 429 insertions(+) create mode 100644 net/ascend-radius/Makefile create mode 100644 net/ascend-radius/distinfo create mode 100644 net/ascend-radius/files/patch-aa create mode 100644 net/ascend-radius/files/patch-ab create mode 100644 net/ascend-radius/files/patch-ac create mode 100644 net/ascend-radius/files/patch-ad create mode 100644 net/ascend-radius/files/patch-ae create mode 100644 net/ascend-radius/files/patch-af create mode 100644 net/ascend-radius/files/patch-ag create mode 100644 net/ascend-radius/pkg-comment create mode 100644 net/ascend-radius/pkg-descr create mode 100644 net/ascend-radius/pkg-plist create mode 100644 net/ascend-radius/scripts/configure (limited to 'net/ascend-radius') diff --git a/net/ascend-radius/Makefile b/net/ascend-radius/Makefile new file mode 100644 index 000000000000..b213348493dd --- /dev/null +++ b/net/ascend-radius/Makefile @@ -0,0 +1,59 @@ +# New ports collection makefile for: ascend-radius +# Version required: 960919 (v1.16) +# Date created: August 28th 96 +# Whom: James FitzGibbon +# +# $Id$ +# + +DISTNAME= rad0919 +PKGNAME= ascend-radius-960919 +CATEGORIES+= net +MASTER_SITES= ftp://ftp.ascend.com/pub/Software-Releases/Radius/Current/ +EXTRACT_SUFX= .gz + +MAINTAINER= jfitz@FreeBSD.ORG + +WRKPREFIX= radius-960919/radius-1.16-ascend +WRKSRC= ${WRKDIR}/${WRKPREFIX}/ascendd + +ALL_TARGET= all dbm + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/radiusd ${PREFIX}/sbin + ${INSTALL_PROGRAM} ${WRKSRC}/radiusd.dbm ${PREFIX}/sbin + ${INSTALL_PROGRAM} ${WRKSRC}/builddbm ${PREFIX}/sbin +.ifdef NOMANCOMPRESS + ${INSTALL_MAN} ${WRKDIR}/${WRKPREFIX}/man1/users-file-syntax.1 ${PREFIX}/man/man1 + ${INSTALL_MAN} ${WRKDIR}/${WRKPREFIX}/man1/builddbm.1 ${PREFIX}/man/man1 +.else + @ ${CP} ${WRKDIR}/${WRKPREFIX}/man1/users-file-syntax.1 ${WRKSRC} + @ ${CP} ${WRKDIR}/${WRKPREFIX}/man1/builddbm.1 ${WRKSRC} + @ gzip -9nf ${WRKSRC}/users-file-syntax.1 + @ gzip -9nf ${WRKSRC}/builddbm.1 + ${INSTALL_MAN} ${WRKSRC}/users-file-syntax.1.gz ${PREFIX}/man/man1 + ${INSTALL_MAN} ${WRKSRC}/builddbm.1.gz ${PREFIX}/man/man1 +.endif +.ifndef NOPORTDOCS + @ mkdir -p ${PREFIX}/share/doc/ascend-radius + for file in ascend.doc draft-ietf-radius-accounting-01.txt draft-ietf-radius-radius-03.txt draft-ietf-radius-radius-04.txt; do \ + ${INSTALL_DATA} ${WRKDIR}/${WRKPREFIX}/doc/$$file ${PREFIX}/share/doc/ascend-radius; \ + done + for file in ChangeLog README README.cexample README.dict; do \ + ${INSTALL_DATA} ${WRKDIR}/${WRKPREFIX}/$$file ${PREFIX}/share/doc/ascend-radius; \ + done +.endif + @ mkdir -p ${PREFIX}/etc/raddb + @ chown root.wheel ${PREFIX}/etc/raddb + @ chmod 700 ${PREFIX}/etc/raddb + for file in clients.example dictionary users.example; do \ + ${INSTALL} -c -o root -g wheel -m 0400 ${WRKDIR}/${WRKPREFIX}/raddb/$$file ${PREFIX}/etc/raddb; \ + done + @ mkdir -p /var/log/radacct + @ chown root.wheel /var/log/radacct + @ chmod 700 /var/log/radacct + +pre-clean: + @ ${RM} -f ${PATCHDIR}/patch-zz + +.include diff --git a/net/ascend-radius/distinfo b/net/ascend-radius/distinfo new file mode 100644 index 000000000000..3af95ae77018 --- /dev/null +++ b/net/ascend-radius/distinfo @@ -0,0 +1 @@ +MD5 (rad0919.gz) = 7b7de79fdc80088c27a023d1f4ef038a diff --git a/net/ascend-radius/files/patch-aa b/net/ascend-radius/files/patch-aa new file mode 100644 index 000000000000..8ea076596d39 --- /dev/null +++ b/net/ascend-radius/files/patch-aa @@ -0,0 +1,45 @@ +--- Makefile.orig Thu Sep 19 20:20:38 1996 ++++ Makefile Mon Sep 23 21:37:19 1996 +@@ -108,8 +108,8 @@ + # Pick your compiler + # + #CC= gcc -ansi -Wall # set the GCC compiler to ANSI mode and picky +-CC= gcc -ansi # set the GCC compiler to ANSI mode +-#CC= gcc # set the GCC compiler for BSDI and friends ++#CC= gcc -ansi # set the GCC compiler to ANSI mode ++CC= gcc # set the GCC compiler for BSDI and friends + #CC= cc -Xc -v -fd # set the SUN compiler to full-whine ANSI mode + #CC= cc -Xc -v # set the SUN compiler to partial-whine ANSI mode + #CC= cc -Xc # set the SUN compiler to ANSI mode +@@ -129,13 +129,15 @@ + # use this for BSDI + #CFLAGS= -O -DNOSHADOW -DBSDI -DBINARY_FILTERS -DASCEND_SECRET -DASCEND_LOGOUT $(AUTH_SERVERS) + # use this for SunOS +-CFLAGS= -O -DNOSHADOW -DOSUN -DBINARY_FILTERS -DASCEND_SECRET -DASCEND_LOGOUT $(AUTH_SERVERS) ++#CFLAGS= -O -DNOSHADOW -DOSUN -DBINARY_FILTERS -DASCEND_SECRET -DASCEND_LOGOUT $(AUTH_SERVERS) + # use this for Solaris 2.1 - 2.4 + #CFLAGS= -O -Dsys5 -DSOLARIS -D_SVID_GETTOD -DBINARY_FILTERS -DASCEND_SECRET -DASCEND_LOGOUT $(AUTH_SERVERS) + # use this for Solaris 2.5 + #CFLAGS= -O -Dsys5 -DSOLARIS -DBINARY_FILTERS -DASCEND_SECRET -DASCEND_LOGOUT $(AUTH_SERVERS) + # use this for Linux + #CFLAGS= -O -Dsys5 -DNOSHADOW -DBINARY_FILTERS -DASCEND_SECRET -DASCEND_LOGOUT $(AUTH_SERVERS) ++# use this for FreeBSD ++CFLAGS= -O -DNOSHADOW -D_HAVE_PARAM_H -DUSE_NDBM -DBINARY_FILTERS -DASCEND_SECRET -DASCEND_LOGOUT $(AUTH_SERVERS) + + # Pick any load options and the load libraries. The AUTH_LIBS + # are selected above +@@ -145,11 +147,12 @@ + # See above for the things you may need to add here + # + #LIBS= $(AUTH_LIBS) # use this for Linux, BSDI and friends +-LIBS= -lnsl $(AUTH_LIBS) # use this for SunOS ++LIBS= $(AUTH_LIBS) -lcrypt # use this for FreeBSD ++#LIBS= -lnsl $(AUTH_LIBS) # use this for SunOS + #LIBS= -lnsl -lsocket $(AUTH_LIBS) # use this for Solaris 2.x + + # use this for SunOs. Linux, BSDI +-DBMLIBS= -ldbm ++DBMLIBS= + # use this for Solaris + #DBMLIBS= + diff --git a/net/ascend-radius/files/patch-ab b/net/ascend-radius/files/patch-ab new file mode 100644 index 000000000000..af3ff7bb60ac --- /dev/null +++ b/net/ascend-radius/files/patch-ab @@ -0,0 +1,24 @@ +--- cache.c.orig Sun Sep 1 02:31:42 1996 ++++ cache.c Mon Sep 23 21:38:20 1996 +@@ -12,13 +12,21 @@ + * FOR A PARTICULAR PURPOSE. + */ + ++#if defined(_HAVE_PARAM_H) ++#include ++#endif ++ + #include + #include + #if defined(BSDI) + # include + # include + #else ++#if defined(__FreeBSD__) ++# include ++#else + # include ++#endif + #endif + #include + #include diff --git a/net/ascend-radius/files/patch-ac b/net/ascend-radius/files/patch-ac new file mode 100644 index 000000000000..606cf37bb3d1 --- /dev/null +++ b/net/ascend-radius/files/patch-ac @@ -0,0 +1,29 @@ +--- conf.h.orig Thu Sep 19 20:04:29 1996 ++++ conf.h Mon Sep 23 21:40:25 1996 +@@ -27,6 +27,10 @@ + * + */ + ++#if defined(_HAVE_PARAM_H) ++#include ++#endif ++ + #ifndef _conf_h_ + #define _conf_h_ + +@@ -56,11 +60,14 @@ + #endif + #endif /* unixware */ + ++#if (defined(BSD) && (BSD >= 199306)) ++#include ++#include + #if defined(BSDI) + #include + #include + #include +-#include ++#endif + #else /* BSDI */ + #include + #endif /* BSDI */ diff --git a/net/ascend-radius/files/patch-ad b/net/ascend-radius/files/patch-ad new file mode 100644 index 000000000000..ae358b7f5a21 --- /dev/null +++ b/net/ascend-radius/files/patch-ad @@ -0,0 +1,34 @@ +--- radiusd.c.orig Thu Sep 19 20:20:38 1996 ++++ radiusd.c Mon Sep 23 21:42:03 1996 +@@ -40,6 +40,10 @@ + static char sccsid[] = + "@(#)radiusd.c 1.17 Copyright 1992 Livingston Enterprises Inc"; + ++#if defined(_HAVE_PARAM_H) ++#include ++#endif ++ + #include + #include + #include +@@ -151,8 +155,10 @@ + #if defined(sys5) || defined(BSDI) + extern char *crypt P__((CONST char *, CONST char *)); + #else ++#if ! defined(__FreeBSD__) + extern char *crypt P__((u_char *, u_char *)); + #endif ++#endif + static void insertValuePair P__((VALUE_PAIR** list, VALUE_PAIR* pair)); + static VALUE_PAIR *copyValuePair P__((VALUE_PAIR* source)); + static AUTH_HDR *prepare_send_buffer P__((AUTH_REQ *authreq, int code)); +@@ -1727,7 +1733,8 @@ + VALUE_PAIR *checkList; + VALUE_PAIR *replyList; + { +- pairfree(authInfo->cutList); ++ if (authInfo->cutList != authInfo->authreq->request) ++ pairfree(authInfo->cutList); + authInfo->cutList = (VALUE_PAIR *)0; + pairfree( checkList ); + pairfree( replyList ); diff --git a/net/ascend-radius/files/patch-ae b/net/ascend-radius/files/patch-ae new file mode 100644 index 000000000000..447979fcbc24 --- /dev/null +++ b/net/ascend-radius/files/patch-ae @@ -0,0 +1,13 @@ +--- radius.h.orig Tue Sep 3 03:42:48 1996 ++++ radius.h Mon Sep 23 21:42:04 1996 +@@ -224,8 +224,8 @@ + + /* Default Database File Names */ + +-#define RADIUS_DIR "/etc/raddb" +-#define RADACCT_DIR "/usr/adm/radacct" ++#define RADIUS_DIR "${PREFIX}/etc/raddb" ++#define RADACCT_DIR "/var/log/radacct" + + #define RADIUS_DICTIONARY "dictionary" + #define RADIUS_CLIENTS "clients" diff --git a/net/ascend-radius/files/patch-af b/net/ascend-radius/files/patch-af new file mode 100644 index 000000000000..a5d2ca238c2c --- /dev/null +++ b/net/ascend-radius/files/patch-af @@ -0,0 +1,96 @@ +--- users.c.orig Thu Sep 19 20:04:29 1996 ++++ users.c Mon Sep 23 21:44:51 1996 +@@ -30,6 +30,10 @@ + static char sccsid[] = + "@(#)users.c 1.12 Copyright 1992 Livingston Enterprises Inc"; + ++#if defined(_HAVE_PARAM_H) ++#include ++#endif ++ + #include + #include + #include +@@ -48,18 +52,30 @@ + # if defined(SOLARIS) + # include + # else ++# if defined(USE_NDBM) ++# include ++# else + # include ++# endif + # endif /* SOLARIS */ + #endif /* DBM_MODE */ + + #include "radius.h" + #include "protos.h" + ++#if (defined(BSD) && (BSD>=199306)) ++#include ++#endif ++ + extern char *progname; + extern int debug_flag; + extern char *radius_dir; + extern char *radius_users; + ++#if (defined(DBM_MODE) && defined(USE_NDBM)) ++DBM *dbp; ++#endif ++ + static int parse_record P__((char *name, char *linep, + VALUE_PAIR **check_first, VALUE_PAIR **reply_first)); + extern int user_read P__((FILE **userfd, char *name, char *content)); +@@ -97,7 +113,15 @@ + { + #if defined(DBM_MODE) + (void)userfd; ++#if defined(USE_NDBM) ++ if(!(dbp=dbm_open(infoname, O_RDONLY, NULL))) { ++ return(-1); ++ } else { ++ return(0); ++ } ++#else + return dbminit(infoname); ++#endif + #else + *userfd = fopen(infoname, "r"); + return *userfd == (FILE *)NULL; +@@ -120,7 +144,11 @@ + { + #if defined(DBM_MODE) + (void)userfd; ++#if defined(USE_NDBM) ++ dbm_close(dbp); ++#else + dbmclose(); ++#endif + #else + fclose(userfd); + #endif +@@ -210,7 +238,11 @@ + #ifdef DBM_MODE + named.dptr = name; + named.dsize = strlen(name)+1; ++#if defined(USE_NDBM) ++ contentd = dbm_fetch(dbp,named); ++#else + contentd = fetch(named); ++#endif + if(contentd.dsize != 0) { /* name found */ + *user_data = contentd.dptr; + userinfo_close(userfd); +@@ -219,7 +251,11 @@ + + named.dptr = "DEFAULT"; + named.dsize = sizeof("DEFAULT"); ++#if defined(USE_NDBM) ++ contentd = dbm_fetch(dbp,named); ++#else + contentd = fetch(named); ++#endif + if(contentd.dsize != 0) { /* DEFAULT found */ + *user_data = contentd.dptr; + userinfo_close(userfd); diff --git a/net/ascend-radius/files/patch-ag b/net/ascend-radius/files/patch-ag new file mode 100644 index 000000000000..45c7b7d4499a --- /dev/null +++ b/net/ascend-radius/files/patch-ag @@ -0,0 +1,103 @@ +--- builddbm.c.orig Wed May 22 20:30:36 1996 ++++ builddbm.c Mon Sep 23 21:48:02 1996 +@@ -30,6 +30,10 @@ + static char sccsid[] = + "@(#)builddbm.c 1.4 Copyright 1992 Livingston Enterprises Inc"; + ++#if defined(_HAVE_PARAM_H) ++#include ++#endif ++ + #if defined(SOLARIS) + # include + # include +@@ -37,7 +41,11 @@ + # include + # include + #else ++#if defined(USE_NDBM) ++# include ++#else + # include ++#endif + #endif /* SOLARIS */ + + #include +@@ -59,8 +67,13 @@ + char *progname; + char *radius_dir; + char *radius_users; ++#if defined(USE_NDBM) ++char dbfile[256]; ++DBM *dbp; ++#else + char pagfile[256]; + char dirfile[256]; ++#endif + char dbmname[256]; + FILE *userfd; + FILE *errf; +@@ -124,6 +137,20 @@ + } + } + ++#if defined(USE_NDBM) ++ sprintf(dbfile, "%s/%s.db", radius_dir, radius_users); ++ if((fd = open(dbfile, O_WRONLY | O_CREAT | O_TRUNC, 0600)) < 0) { ++ fprintf(errf, "%s: Couldn't open %s for writing\n", ++ progname, dbfile); ++ exit(-1); ++ } ++ close(fd); ++ sprintf(dbmname, "%s/%s", radius_dir, radius_users); ++ if(!(dbp=dbm_open(dbmname, O_RDWR | O_CREAT | O_TRUNC, 0600))) { ++ fprintf(errf, "%s: Couldn't dbm_open(%s)\n", ++ progname, dbmname); ++ } ++#else + sprintf(pagfile, "%s/%s.pag", radius_dir, radius_users); + if((fd = open(pagfile, O_WRONLY | O_CREAT | O_TRUNC, 0600)) < 0) { + fprintf(errf, "%s: Couldn't open %s for writing\n", +@@ -143,7 +170,7 @@ + fprintf(errf, "%s: Couldn't dbminit(%s)\n", progname, dbmname); + exit(-1); + } +- ++#endif + userfd = (FILE *)NULL; + curParseLine = 0; + while(user_read(&userfd, name, content) == 0) { +@@ -153,7 +180,11 @@ + } + named.dptr = name; + named.dsize = strlen(name)+1; ++#if defined(USE_NDBM) ++ contentd = dbm_fetch(dbp,named); ++#else + contentd = fetch(named); ++#endif + if(contentd.dsize != 0) { /* name found */ + warn("Skipping duplicate record\n\tfor user '%s'", name); + continue; +@@ -162,13 +193,21 @@ + named.dsize = strlen(name)+1; + contentd.dptr = content; + contentd.dsize = strlen(content)+1; ++#if defined(USE_NDBM) ++ if(dbm_store(dbp, named, contentd, DBM_INSERT) < 0) { ++#else + if(store(named, contentd) != 0) { ++#endif + fprintf(errf, "%s: Couldn't store datum for %s\n", + progname, name); + exit(-1); + } + } ++#if defined(USE_NDBM) ++ dbm_close(dbp); ++#else + dbmclose(); ++#endif + exit(0); + } + diff --git a/net/ascend-radius/pkg-comment b/net/ascend-radius/pkg-comment new file mode 100644 index 000000000000..2ec1e09d044b --- /dev/null +++ b/net/ascend-radius/pkg-comment @@ -0,0 +1 @@ +The Ascend modified Radius Daemon \ No newline at end of file diff --git a/net/ascend-radius/pkg-descr b/net/ascend-radius/pkg-descr new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/net/ascend-radius/pkg-plist b/net/ascend-radius/pkg-plist new file mode 100644 index 000000000000..d93671970fca --- /dev/null +++ b/net/ascend-radius/pkg-plist @@ -0,0 +1,18 @@ +sbin/radiusd +sbin/radiusd.dbm +sbin/builddbm +man/man1/users-file-syntax.1.gz +man/man1/builddbm.1.gz +share/doc/ascend-radius/ascend.doc +share/doc/ascend-radius/draft-ietf-radius-accounting-01.txt +share/doc/ascend-radius/draft-ietf-radius-radius-03.txt +share/doc/ascend-radius/draft-ietf-radius-radius-04.txt +share/doc/ascend-radius/ChangeLog +share/doc/ascend-radius/README +share/doc/ascend-radius/README.cexample +share/doc/ascend-radius/README.dict +etc/raddb/clients.example +etc/raddb/dictionary +etc/raddb/users.example +@dirrm share/doc/ascend-radius +@dirrm etc/raddb diff --git a/net/ascend-radius/scripts/configure b/net/ascend-radius/scripts/configure new file mode 100644 index 000000000000..5adf036a5131 --- /dev/null +++ b/net/ascend-radius/scripts/configure @@ -0,0 +1,6 @@ +#!/bin/sh + +cd $WRKSRC || exit 1 + +cp radius.h radius.h.old +sed -e "s:@@PREFIX@@:$PREFIX:g" < radius.h.old > radius.h -- cgit v1.2.3