Only in src: .paf
diff -u src-fixed/Makefile src/Makefile
--- src-fixed/Makefile	Wed Nov 19 03:14:15 1997
+++ src/Makefile	Sun Nov 23 21:02:26 1997
@@ -14,7 +14,7 @@
 # unixware: add -Dunixware to CFLAGS, use LIBS= -lucb -lnsl -lsocket
 #
 SRCDIR=.
-CFLAGS= -O -DNOSHADOW
+CFLAGS= -g -DNOSHADOW
 LDFLAGS=
 CC=	cc
 LIBS= -lcrypt
diff -u src-fixed/acct.c src/acct.c
--- src-fixed/acct.c	Wed Nov 19 03:14:15 1997
+++ src/acct.c	Sun Nov 23 18:57:18 1997
@@ -32,6 +32,7 @@
 #include	<sys/socket.h>
 #include	<sys/time.h>
 #include	<sys/file.h>
+#include 	<sys/stat.h>
 #include	<netinet/in.h>
 
 #include	<stdio.h>
@@ -41,6 +42,7 @@
 #include	<ctype.h>
 #include	<unistd.h>
 #include	<signal.h>
+#include	<limits.h>
 #include	<errno.h>
 #include	<sys/wait.h>
 
@@ -58,6 +60,8 @@
 
 UINT4			calctime();
 
+static void exec_loginoutrc(VALUE_PAIR *vp);
+
 rad_accounting(authreq, activefd)
 AUTH_REQ	*authreq;
 int		activefd;
@@ -69,7 +73,8 @@
 	VALUE_PAIR	*pair;
 	long		curtime;
 
-	strcpy(clientname, ip_hostname(authreq->ipaddr));
+	strncpy(clientname, ip_hostname(authreq->ipaddr), 128);
+	clientname[127] = '\0';
 
 	/*
 	 * Create a directory for this client.
@@ -95,6 +100,9 @@
 
 		/* Write each attribute/value to the log file */
 		pair = authreq->request;
+
+		exec_loginoutrc(pair);
+
 		while(pair != (VALUE_PAIR *)NULL) {
 			fputs("\t", outfd);
 			fprint_attr_val(outfd, pair);
@@ -215,3 +223,42 @@
 	sendto(activefd, (char *)auth, (int)total_length, (int)0,
 			(struct sockaddr *) sin, sizeof(struct sockaddr_in));
 }
+
+static void exec_loginoutrc(VALUE_PAIR *vp) {
+	struct stat sb;
+	char name[AUTH_STRING_LEN] = { 0x00 };
+	char buffer[PATH_MAX];
+	int start = -1;
+	int l;
+
+	for(/**/; vp; vp = vp->next) {
+		if(vp->attribute == PW_ACCT_STATUS_TYPE)
+			start = vp->lvalue;
+
+		if(vp->attribute == PW_USER_NAME) {
+			strncpy(name, vp->strvalue, AUTH_STRING_LEN);
+			name[AUTH_STRING_LEN - 1] = '\0';
+		}
+	}
+
+	if(start < 0 || name[0] == '\0')
+		return;
+
+	snprintf(buffer, PATH_MAX, "%s/%s/%s.%s", radacct_dir, RC_DIR,
+			 name, (start == PW_STATUS_START) ? 	
+					 RC_EXTENSION_START :
+					 RC_EXTENSION_STOP);
+	buffer[PATH_MAX - 1] = '\0';
+
+	if(stat(buffer, &sb) < 0) 
+		return;
+
+	switch(fork()) {
+	case 0:
+		exit(execl(buffer, buffer, NULL));
+
+	default:
+		return;
+	}
+}		
+
diff -u src-fixed/radius.h src/radius.h
--- src-fixed/radius.h	Wed Nov 19 03:14:14 1997
+++ src/radius.h	Sun Nov 23 18:56:06 1997
@@ -202,3 +202,8 @@
 #define MAX_REQUEST_TIME	30
 #define CLEANUP_DELAY		5
 #define MAX_REQUESTS		100
+
+#define	RC_DIR			"loginscripts"
+#define RC_EXTENSION_START	"login"
+#define RC_EXTENSION_STOP	"logout"
+
diff -u src-fixed/radiusd.c src/radiusd.c
--- src-fixed/radiusd.c	Wed Nov 19 03:14:14 1997
+++ src/radiusd.c	Sun Nov 23 21:06:31 1997
@@ -307,6 +307,19 @@
 				(int) 0, & saremote, & salen);
 
 			if(result > 0) {
+
+#ifdef CHECK_KNOWNCLIENT
+				if(!knownclient(ntohl(sin->sin_addr.s_addr))) {
+					/* packet, meet floor */
+
+					char lbuf[128];
+					sprintf(lbuf, "Unknown Client - %s",
+						inet_ntoa(sin->sin_addr));
+					log_err(lbuf);
+					continue;
+				}						
+#endif
+
 				authreq = radrecv(
 					ntohl(sin->sin_addr.s_addr),
 					ntohs(sin->sin_port),
@@ -495,6 +508,8 @@
 {
 	switch(authreq->code) {
 
+#ifdef HANDLE_AUTHENTICATION_REQUESTS
+
 	case PW_AUTHENTICATION_REQUEST:
 		if(spawn_flag) {
 			rad_spawn_child(authreq, activefd);
@@ -503,14 +518,20 @@
 			rad_authenticate(authreq, activefd);
 		}
 		break;
-	
+
+#endif
+
 	case PW_ACCOUNTING_REQUEST:
 		rad_accounting(authreq, activefd);
 		break;
+
+#ifdef HANDLE_PASSCHANGE_REQUESTS 
 	
 	case PW_PASSWORD_REQUEST:
 		rad_passchange(authreq, activefd);
 		break;
+
+#endif
 	
 	default:
 		break;
@@ -568,8 +589,12 @@
 		else if(curreq->ipaddr == authreq->ipaddr &&
 					curreq->id == authreq->id) {
 			/* This is a duplicate request - just drop it */
-			sprintf(msg, "Dropping duplicate: from %s - ID: %d\n",
+
+			snprintf(msg, 128,
+				"Dropping duplicate: from %s - ID: %d\n",
 				ip_hostname(authreq->ipaddr), authreq->id);
+			msg[127] = '\0';
+
 			log_err(msg);
 			pairfree(authreq->request);
 			free(authreq);
@@ -595,8 +620,11 @@
 
 	/* This is a new request */
 	if(request_count > MAX_REQUESTS) {
-		sprintf(msg, "Dropping request (too many): from %s - ID: %d\n",
+		snprintf(msg, 128, 
+			"Dropping request (too many): from %s - ID: %d\n",
 				ip_hostname(authreq->ipaddr), authreq->id);
+		msg[127] = '\0';
+
 		log_err(msg);
 		pairfree(authreq->request);
 		free(authreq);
@@ -618,8 +646,11 @@
 	/* fork our child */
 	child_pid = fork();
 	if(child_pid < 0) {
-		sprintf(msg, "Fork failed for request from %s - ID: %d\n",
+		snprintf(msg, 128,  
+			"Fork failed for request from %s - ID: %d\n",
 				ip_hostname(authreq->ipaddr), authreq->id);
+		msg[127] = '\0';
+
 		log_err(msg);
 	}
 	if(child_pid == 0) {
@@ -702,9 +733,11 @@
 		namepair = namepair->next;
 	}
 	if(namepair == (VALUE_PAIR *)NULL) {
-		sprintf(msg,
+		snprintf(msg, 128, 
 			"Passchange: from %s - No User name supplied\n",
 			ip_hostname(authreq->ipaddr));
+		msg[127] = '\0';
+
 		log_err(msg);
 		pairfree(authreq->request);
 		memset(authreq, 0, sizeof(AUTH_REQ));
@@ -716,11 +749,17 @@
 	 * Look the user up in the database
 	 */
 	if(user_find(namepair->strvalue, &user_check, &user_reply) != 0) {
-		sprintf(msg,
+		snprintf(msg, 127,
 			"Passchange: from %s - Invalid User: %s\n",
 			ip_hostname(authreq->ipaddr), namepair->strvalue);
+		msg[127] = '\0';
+
 		log_err(msg);
+
+#ifdef ACK_BOGUS_PASSCHANGE
 		send_reject(authreq, (char *)NULL, activefd);
+#endif 
+
 		pairfree(authreq->request);
 		memset(authreq, 0, sizeof(AUTH_REQ));
 		free(authreq);
@@ -754,11 +793,17 @@
 	if(newpasspair == (VALUE_PAIR *)NULL ||
 					oldpasspair == (VALUE_PAIR *)NULL) {
 		/* Missing one of the passwords */
-		sprintf(msg,
+		snprintf(msg, 128, 
 			"Passchange: from %s - Missing Password: %s\n",
 			ip_hostname(authreq->ipaddr), namepair->strvalue);
+		msg[127] = '\0';
+
 		log_err(msg);
+
+#ifdef ACK_BOGUS_PASSCHANGE
 		send_reject(authreq, (char *)NULL, activefd);
+#endif
+
 		pairfree(authreq->request);
 		pairfree(user_check);
 		pairfree(user_reply);
@@ -777,11 +822,16 @@
 	}
 	if((curpass == (VALUE_PAIR *)NULL) || curpass->strvalue == (char *)NULL) {
 		/* Missing our local copy of the password */
-		sprintf(msg,
+		snprintf(msg, 127, 
 			"Passchange: from %s - Missing Local Password: %s\n",
 			ip_hostname(authreq->ipaddr), namepair->strvalue);
+		msg[127] = '\0';
 		log_err(msg);
+
+#ifdef ACK_BOGUS_PASSCHANGE
 		send_reject(authreq, (char *)NULL, activefd);
+#endif
+
 		pairfree(authreq->request);
 		pairfree(user_check);
 		pairfree(user_reply);
@@ -791,11 +841,17 @@
 	}
 	if(strcmp(curpass->strvalue,"UNIX") == 0) {
 		/* Can't change passwords that aren't in users file */
-		sprintf(msg,
+		snprintf(msg, 127, 
 			"Passchange: from %s - system password change not allowed: %s\n",
 			ip_hostname(authreq->ipaddr), namepair->strvalue);
+		msg[127] = '\0';
+
 		log_err(msg);
+
+#ifdef ACK_BOGUS_PASSCHANGE
 		send_reject(authreq, (char *)NULL, activefd);
+#endif
+
 		pairfree(authreq->request);
 		pairfree(user_check);
 		pairfree(user_reply);
@@ -816,9 +872,10 @@
 
 	/* Did they supply the correct password ??? */
 	if(strncmp(passbuf, curpass->strvalue, AUTH_PASS_LEN) != 0) {
-		sprintf(msg,
+		snprintf(msg, 127,
 			"Passchange: from %s - Incorrect Password: %s\n",
 			ip_hostname(authreq->ipaddr), namepair->strvalue);
+		msg[127] = '\0';
 		log_err(msg);
 		send_reject(authreq, (char *)NULL, activefd);
 		pairfree(authreq->request);
@@ -849,9 +906,10 @@
 	/* Update the database */
 	if(user_update(namepair->strvalue, user_check, user_reply) != 0) {
 		send_reject(authreq, (char *)NULL, activefd);
-		sprintf(msg,
+		snprintf(msg, 127,
 			"Passchange: unable to update password for %s\n",
 			namepair->strvalue);
+		msg[127] = '\0';
 		log_err(msg);
 
 	}
@@ -904,8 +962,10 @@
 	}
 	if((namepair == (VALUE_PAIR *)NULL) || 
 	   (strlen(namepair->strvalue) <= 0)) {
-		sprintf(msg, "Authenticate: from %s - No User Name\n",
+		snprintf(msg, 127,
+			"Authenticate: from %s - No User Name\n",
 			ip_hostname(authreq->ipaddr));
+		msg[127] = '\0';
 		log_err(msg);
 		pairfree(authreq->request);
 		memset(authreq, 0, sizeof(AUTH_REQ));
@@ -916,8 +976,10 @@
 	/* Verify the client and Calculate the MD5 Password Digest */
 	if(calc_digest(pw_digest, authreq) != 0) {
 		/* We dont respond when this fails */
-		sprintf(msg, "Authenticate: from %s - Security Breach: %s\n",
+		snprintf(msg, 127,
+			"Authenticate: from %s - Security Breach: %s\n",
 			ip_hostname(authreq->ipaddr), namepair->strvalue);
+		msg[127] = '\0';
 		log_err(msg);
 		pairfree(authreq->request);
 		memset(authreq, 0, sizeof(AUTH_REQ));
@@ -927,8 +989,10 @@
 
 	/* Get the user from the database */
 	if(user_find(namepair->strvalue, &user_check, &user_reply) != 0) {
-		sprintf(msg, "Authenticate: from %s - Invalid User: %s\n",
+		snprintf(msg, 127,
+			"Authenticate: from %s - Invalid User: %s\n",
 			ip_hostname(authreq->ipaddr), namepair->strvalue);
+		msg[127] = '\0';
 		log_err(msg);
 		send_reject(authreq, (char *)NULL, activefd);
 		pairfree(authreq->request);
@@ -1500,10 +1564,15 @@
 	 * Not secure, but worth the check for accidental requests
 	 */
 	if(ipaddr != authreq->ipaddr) {
-		strcpy(hostnm,ip_hostname(ipaddr));
-		sprintf(msg, "requester address mismatch: %s != %s\n",
+		strncpy(hostnm,ip_hostname(ipaddr), 256);
+		hostnm[255] = '\0';
+
+		snprintf(msg, 127,
+			"requester address mismatch: %s != %s\n",
 			hostnm,
 			ip_hostname(authreq->ipaddr));
+		msg[127] = '\0';
+
 		log_err(msg);
 		memset(secret, 0, sizeof(secret));
 		return(-1);
@@ -1566,7 +1635,7 @@
 char	*msg;
 {
 	FILE	*msgfd;
-	char	buffer[128];
+	char	buffer[1024];
 	time_t	timeval;
 
 	sprintf(buffer, "%s/%s", radius_dir, RADIUS_LOG);
Only in src: src.proj
diff -u src-fixed/util.c src/util.c
--- src-fixed/util.c	Wed Nov 19 03:14:15 1997
+++ src/util.c	Wed Nov 19 03:21:41 1997
@@ -226,3 +226,37 @@
 	return(ipaddr);
 }
 
+#ifdef CHECK_KNOWNCLIENT
+
+int knownclient(UINT4 address) {
+	FILE *fp;
+	char buffer[1024];
+
+	snprintf(buffer, 1024, "%s/%s", radius_dir, RADIUS_CLIENTS);
+	buffer[1023] = '\0';
+
+	if(!(fp = fopen(buffer, "r")))
+		return(0);
+
+	while(fgets(buffer, 1024, fp)) {
+		char *hostname, *secret;
+		UINT4 caddr;
+
+		if(*buffer == '#')
+			continue;
+
+		if(sscanf(buffer, "%s%s", hostname, secret) != 2)
+			continue;
+
+		caddr = get_ipaddr(hostname);
+		if(caddr == address) {
+			fclose(fp);
+			return(1);
+		}
+	}
+
+	fclose(fp);
+	return(0);
+}
+
+#endif /* CHECK_KNOWNCLIENT */
