1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-23 04:23:08 +00:00

Add new port: net/xtradius

A RADIUS-compliant remote authentication and accouting server

PR:		21097
Submitted by:	Gene Raytsin <pal@paladin7.net>
This commit is contained in:
James E. Housley 2000-10-23 02:44:41 +00:00
parent 7006dca30a
commit 4c07d7dc6c
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=34121
11 changed files with 368 additions and 0 deletions

View File

@ -275,6 +275,7 @@
SUBDIR += xipmsg
SUBDIR += xisp
SUBDIR += xtraceroute
SUBDIR += xtradius
SUBDIR += xwhois
SUBDIR += ytalk
SUBDIR += zebra

65
net/xtradius/Makefile Normal file
View File

@ -0,0 +1,65 @@
# New ports collection makefile for: xtradius
# Date created: 06 September 2000
# Whom: pal@paladin7.net
#
# $FreeBSD$
#
PORTNAME= xtradius
PORTVERSION= 1.0b3
CATEGORIES= net
MASTER_SITES= http://www.xtradius.com/download/
DISTNAME= xtradius-1.0beta3
EXTRACT_SUFX= .tgz
MAINTAINER= pal@paladin7.net
MAKEFILE= Makefile.BSD
MAN1= radlast.1 radtest.1 raduse.1 radwho.1 radzap.1
MAN5= clients.5rad naslist.5rad
MAN8= radiusd.8 radwatch.8
VARD= /var/log
do-build:
cd ${WRKSRC}/src && ${SETENV} ${MAKE_ENV} ${MAKE} -f ${MAKEFILE}
do-install:
cd ${WRKSRC}/src && ${SETENV} ${MAKE_ENV} ${MAKE} -f ${MAKEFILE} install
@${MKDIR} -m 700 ${VARD}/radacct
.if !defined(NOPORTDOCS)
@${MKDIR} ${PREFIX}/share/doc/radiusd-xtradius
${INSTALL_DATA} ${WRKSRC}/COPYRIGHT.Cistron ${PREFIX}/share/doc/radiusd-xtradius
${INSTALL_DATA} ${WRKSRC}/COPYRIGHT.Livingston ${PREFIX}/share/doc/radiusd-xtradius
${INSTALL_DATA} ${WRKSRC}/doc/ChangeLog ${PREFIX}/share/doc/radiusd-xtradius
${INSTALL_DATA} ${WRKSRC}/doc/INSTALL.OLD ${PREFIX}/share/doc/radiusd-xtradius
${INSTALL_DATA} ${WRKSRC}/doc/README ${PREFIX}/share/doc/radiusd-xtradius
${INSTALL_DATA} ${WRKSRC}/doc/README.Y2K ${PREFIX}/share/doc/radiusd-xtradius
${INSTALL_DATA} ${WRKSRC}/doc/README.cisco ${PREFIX}/share/doc/radiusd-xtradius
${INSTALL_DATA} ${WRKSRC}/doc/README.pam ${PREFIX}/share/doc/radiusd-xtradius
${INSTALL_DATA} ${WRKSRC}/doc/README.proxy ${PREFIX}/share/doc/radiusd-xtradius
${INSTALL_DATA} ${WRKSRC}/doc/README.simul ${PREFIX}/share/doc/radiusd-xtradius
${INSTALL_DATA} ${WRKSRC}/doc/README.usersfile ${PREFIX}/share/doc/radiusd-xtradius
.endif
${INSTALL_MAN} ${WRKSRC}/doc/radlast.1 ${MANPREFIX}/man/man1
${INSTALL_MAN} ${WRKSRC}/doc/radtest.1 ${MANPREFIX}/man/man1
${INSTALL_MAN} ${WRKSRC}/doc/raduse.1 ${MANPREFIX}/man/man1
${INSTALL_MAN} ${WRKSRC}/doc/radwho.1 ${MANPREFIX}/man/man1
${INSTALL_MAN} ${WRKSRC}/doc/radzap.1 ${MANPREFIX}/man/man1
${INSTALL_MAN} ${WRKSRC}/doc/clients.5rad ${MANPREFIX}/man/man5
${INSTALL_MAN} ${WRKSRC}/doc/naslist.5rad ${MANPREFIX}/man/man5
${INSTALL_MAN} ${WRKSRC}/doc/radiusd.8 ${MANPREFIX}/man/man8
${INSTALL_MAN} ${WRKSRC}/doc/radwatch.8 ${MANPREFIX}/man/man8
post-install:
${INSTALL_DATA} ${WRKSRC}/contrib/pg_xtradius/users ${PREFIX}/etc/raddb/users.pg
${INSTALL_DATA} ${WRKSRC}/contrib/pg_xtradius/pg_auth.pl ${PREFIX}/etc/raddb
${INSTALL_DATA} ${WRKSRC}/contrib/pg_xtradius/pg_acct.pl ${PREFIX}/etc/raddb
@${CHMOD} 555 ${PREFIX}/etc/raddb/pg_acct.pl ${PREFIX}/etc/raddb/pg_auth.pl
@${CHOWN} root.wheel ${PREFIX}/etc/raddb/pg_acct.pl
@${CHOWN} root.wheel ${PREFIX}/etc/raddb/pg_auth.pl
@${SED} -e "s=!!PREFIX!!=${PREFIX}=g" ${FILESDIR}/radiusd.sh.tmpl \
> ${PREFIX}/etc/rc.d/radiusd.sh
@${CHMOD} 555 ${PREFIX}/etc/rc.d/radiusd.sh
@${CHOWN} root.wheel ${PREFIX}/etc/rc.d/radiusd.sh
.include <bsd.port.mk>

1
net/xtradius/distinfo Normal file
View File

@ -0,0 +1 @@
MD5 (xtradius-1.0beta3.tgz) = b420be9e2f3d8bd0e96c27c439c50eb3

View File

@ -0,0 +1,25 @@
--- src/Makefile.BSD.orig Fri Aug 25 16:30:17 2000
+++ src/Makefile.BSD Fri Aug 25 16:32:14 2000
@@ -3,9 +3,9 @@
#
#
-CC = gcc
-CFLAGS = -Wall -g -DNOSHADOW -DXTRADIUS
-LDFLAGS = # -s #tatic
+#CC = gcc
+CFLAGS = -DNOSHADOW -DXTRADIUS
+LDFLAGS = -s #static
LIBS =
LCRYPT = -lcrypt
@@ -15,7 +15,7 @@
#PAM = -DPAM
#PAMLIB = -lpam
-BINDIR = /usr/local/bin
-SBINDIR = /usr/local/sbin
+BINDIR = $(PREFIX)/bin
+SBINDIR = $(PREFIX)/sbin
.include "Make.inc"

View File

@ -0,0 +1,53 @@
--- src/Make.inc.orig Mon Apr 3 11:00:59 2000
+++ src/Make.inc Wed May 3 18:56:35 2000
@@ -4,7 +4,7 @@
#
#
-RADIUS_DIR = /etc/raddb
+RADIUS_DIR = ${PREFIX}/etc/raddb
SERVER_OBJS = radiusd.o dict.o files.o util.o md5.o attrprint.o \
acct.o radius.o pam.o log.o version.o proxy.o \
@@ -111,21 +111,20 @@
install:
# Install the binaries
- install -d $(SBINDIR)
- install -d $(BINDIR)
- install -d $(RADIUS_DIR)
- install -m 755 -s radiusd $(SBINDIR)/radiusd
- install -m 755 -s radwho $(BINDIR)
- install -m 755 -s raduse $(BINDIR)
- install -m 755 -s radzap $(BINDIR)
- install -m 755 -s radtest $(BINDIR)
- install -m 755 checkrad.pl $(SBINDIR)/checkrad
- install -m 755 radlast $(BINDIR)
+ ${INSTALL} -d $(RADIUS_DIR)
+ ${BSD_INSTALL_PROGRAM} radiusd $(SBINDIR)/radiusd
+ ${BSD_INSTALL_PROGRAM} radwho $(BINDIR)
+ ${BSD_INSTALL_PROGRAM} raduse $(BINDIR)
+ ${BSD_INSTALL_PROGRAM} radzap $(BINDIR)
+ ${BSD_INSTALL_PROGRAM} radtest $(BINDIR)
+ ${BSD_INSTALL_SCRIPT} ../scripts/radwatch ${SBINDIR}/radwatch
+ ${BSD_INSTALL_SCRIPT} checkrad.pl $(SBINDIR)/checkrad
+ ${BSD_INSTALL_SCRIPT} radlast $(BINDIR)
# Install the config files
@echo "Creating/updating files in $(RADIUS_DIR)"; \
cd ../raddb; \
for i in [a-c]* [e-z]*; do \
- [ ! -f $(RADIUS_DIR)/$$i ] && cp $$i $(RADIUS_DIR)/$$i; \
+ [ ! -f $(RADIUS_DIR)/$$i ] && cp $$i $(RADIUS_DIR)/$$i; \
done; \
for i in dictionary*; do \
[ ! -f $(RADIUS_DIR)/$$i ] && cp $$i $(RADIUS_DIR)/$$i; \
@@ -133,8 +132,4 @@
echo "** $(RADIUS_DIR)/$$i"; \
nt=1; \
fi; \
- done; \
- if [ "$$nt" ]; then \
- echo "** The samples in ../raddb are newer than these files";\
- echo "** Please investigate and copy manually if appropriate";\
- fi
+ done;

View File

@ -0,0 +1,10 @@
--- src/conf.h Wed Sep 6 18:28:45 2000
+++ conf.h Wed Sep 6 18:30:44 2000
@@ -1,6 +1,6 @@
/* Default Database File Names */
-#define RADIUS_DIR "/etc/raddb"
+#define RADIUS_DIR "/usr/local/etc/raddb"
#define RADLOG_DIR "/var/log"
#ifdef aix

129
net/xtradius/files/patch-ad Normal file
View File

@ -0,0 +1,129 @@
--- src/radwho.c.orig Fri Feb 25 05:47:53 2000
+++ src/radwho.c Wed May 3 18:43:24 2000
@@ -16,6 +16,7 @@
#include <errno.h>
#include <sys/stat.h>
#include <sys/utsname.h>
+#include <sys/ioctl.h>
#include <time.h>
#include <ctype.h>
#include <netinet/in.h>
@@ -34,18 +35,21 @@
* Header above output and format.
*/
char *hdr1 =
-"Login Name What TTY When From Location";
-char *ufmt1 = "%-10.10s %-17.17s %-5.5s %-4.4s %-9.9s %-9.9s %-.16s%s";
+"Login Name What TTY When From Location";
+char *ufmt1 = "%-16.16s %-17.17s %-5.5s %-4.4s %-9.9s %-9.9s %-.*s%s";
char *ufmt1r = "%s,%s,%s,%s,%s,%s,%s%s";
-char *rfmt1 = "%-10.10s %-17.17s %-5.5s %s%-3d %-9.9s %-9.9s %-.19s%s";
+char *rfmt1 = "%-16.16s %-17.17s %-5.5s %s%-3d %-9.9s %-9.9s %-.*s%s";
char *rfmt1r = "%s,%s,%s,%s%d,%s,%s,%s%s";
+#define FMT1_HOST_SIZE 13
char *hdr2 =
-"Login Port What When From Location";
-char *ufmt2 = "%-10.10s %-6.6d %-7.7s %-13.13s %-10.10s %-.16s%s";
+"Login Port What When From Location";
+char *ufmt2 = "%-16.16s %-6.6d %-7.7s %-13.13s %-10.10s %-.*s%s";
char *ufmt2r = "%s,%d,%s,%s,%s,%s%s";
-char *rfmt2 = "%-10.10s %s%-5d %-6.6s %-13.13s %-10.10s %-.28s%s";
+char *rfmt2 = "%-16.16s %s%-5d %-6.6s %-13.13s %-10.10s %-.*s%s";
char *rfmt2r = "%s,%s%d,%s,%s,%s,%s%s";
+#define FMT2_HOST_SIZE 19
+
char *eol = "\n";
NAS *naslist;
@@ -301,7 +305,8 @@
return tmp;
}
if (strncmp(tty, "cu", 2) == 0) {
- return tmp + 2;
+ sprintf(tmp, "%.15s", tty + 2);
+ return tmp;
}
return "??";
}
@@ -363,6 +368,8 @@
*/
int main(int argc, char **argv)
{
+ struct winsize ws;
+ int extra_width = 0;
FILE *fp;
struct radutmp rt;
struct utmp ut;
@@ -378,6 +385,11 @@
char *p, *q, *portind;
int c, portno;
+ ioctl(0, TIOCGWINSZ, &ws);
+ if (ws.ws_col >= 80) {
+ extra_width = ws.ws_col - 80;
+ }
+
while((c = getopt(argc, argv, "flhnsipcr")) != EOF) switch(c) {
case 'f':
fingerd++;
@@ -465,14 +477,17 @@
while(fread(&ut, sizeof(ut), 1, fp) == 1) {
#ifdef USER_PROCESS
if (ut.ut_user[0] && ut.ut_line[0] &&
- ut.ut_type == USER_PROCESS) {
+ ut.ut_type == USER_PROCESS)
#else
- if (ut.ut_user[0] && ut.ut_line[0]) {
+ if (ut.ut_user[0] && ut.ut_line[0])
#endif
- if (showname)
+ {
+ strncpy(inbuf, ut.ut_name, UT_NAMESIZE);
+ inbuf[UT_NAMESIZE] = '\0';
+ if (showname)
printf((rawoutput == 0? ufmt1: ufmt1r),
- ut.ut_name,
- fullname(ut.ut_name),
+ inbuf,
+ fullname(inbuf),
"shell",
ttyshort(ut.ut_line),
#ifdef __svr4__
@@ -481,10 +496,11 @@
dotime(ut.ut_time),
#endif
ut.ut_host,
+ FMT1_HOST_SIZE + extra_width,
myname, eol);
else
printf((rawoutput==0? ufmt2:ufmt2r),
- ut.ut_name,
+ inbuf,
ttyshort(ut.ut_line),
"shell",
#ifdef __svr4__
@@ -493,6 +509,7 @@
dotime(ut.ut_time),
#endif
ut.ut_host,
+ FMT2_HOST_SIZE + extra_width,
myname, eol);
}
}
@@ -537,6 +554,7 @@
portind, portno,
dotime(rt.time),
nasname(ntohl(rt.nas_address)),
+ FMT1_HOST_SIZE + extra_width,
hostname(rt.framed_address), eol);
else
printf((rawoutput == 0? rfmt2: rfmt2r),
@@ -545,6 +563,7 @@
proto(rt.proto, rt.porttype),
dotime(rt.time),
nasname(ntohl(rt.nas_address)),
+ FMT2_HOST_SIZE + extra_width,
hostname(rt.framed_address), eol);
}
}

View File

@ -0,0 +1,27 @@
#!/bin/sh
#
PREFIX=/usr/local/sbin
case "$1" in
start)
if [ -x ${PREFIX}/radiusd ]
then
${PREFIX}/radiusd -y & && echo -n " radiusd"
fi
;;
stop)
if [ -r /var/run/radiusd.pid ]
then
kill `cat /var/run/radiusd.pid` && echo -n " radiusd"
fi
;;
*)
echo "usage: $0 {start|stop}" 1>&2
exit 64
;;
esac

1
net/xtradius/pkg-comment Normal file
View File

@ -0,0 +1 @@
A RADIUS-compliant remote authentication and accouting server

8
net/xtradius/pkg-descr Normal file
View File

@ -0,0 +1,8 @@
XtRadius is a freeware radius server implementation. The main feature is that it
can handle user accounting and authentication informations via external fully
configurable scripts.
The XtRadius server is based on Cistron Radius 1.6.3. You can write script to
make you own auth and/or accounting routines without having to patch the main
server.
WWW: http://www.xtradius.com

48
net/xtradius/pkg-plist Normal file
View File

@ -0,0 +1,48 @@
bin/radlast
bin/radtest
bin/raduse
bin/radwho
bin/radzap
sbin/checkrad
sbin/radiusd
sbin/radwatch
etc/raddb/clients
etc/raddb/dictionary
etc/raddb/dictionary.ascend
etc/raddb/dictionary.cisco
etc/raddb/dictionary.compat
etc/raddb/dictionary.livingston
etc/raddb/dictionary.shiva
etc/raddb/dictionary.tunnel
etc/raddb/dictionary.usr
etc/raddb/dictionary.versanet
etc/raddb/dictionary.xtradius
etc/raddb/execparams
etc/raddb/hints
etc/raddb/huntgroups
etc/raddb/naslist
etc/raddb/naspasswd
etc/raddb/realms
etc/raddb/users
etc/raddb/users.pg
etc/raddb/pg_auth.pl
etc/raddb/pg_acct.pl
share/doc/radiusd-xtradius/COPYRIGHT.Cistron
share/doc/radiusd-xtradius/COPYRIGHT.Livingston
share/doc/radiusd-xtradius/ChangeLog
share/doc/radiusd-xtradius/INSTALL.OLD
share/doc/radiusd-xtradius/README
share/doc/radiusd-xtradius/README.Y2K
share/doc/radiusd-xtradius/README.cisco
share/doc/radiusd-xtradius/README.pam
share/doc/radiusd-xtradius/README.proxy
share/doc/radiusd-xtradius/README.simul
share/doc/radiusd-xtradius/README.usersfile
etc/rc.d/radiusd.sh
@exec mkdir -m 700 /var/log/radacct
@dirrm etc/raddb
@dirrm share/doc/radiusd-xtradius
@unexec rm -f /var/log/radius.log
@unexec rm -f /var/run/radiusd.pid
@unexec rmdir /var/log/radacct
@unexec echo "Leaving /var/run/radutmp, /var/log/radwtmp and /var/log/radacct alone."