diff -urN openradius-0.9.9/CHANGELOG openradius-0.9.9c/CHANGELOG
--- openradius-0.9.9/CHANGELOG	Wed Aug 11 16:50:31 2004
+++ openradius-0.9.9c/CHANGELOG	Fri Nov 19 14:42:28 2004
@@ -1,5 +1,17 @@
-2004/08/xx - 0.9.9
+2004/11/19 - 0.9.9c
+
+	- Updated example behaviour file behaviour.sample-usersfile to show
+	  how PAP passwords longer than 16 characters can be handled
+
+	- Fixed problem caused by missing file etc/openradius/legacy/nases
 
+	- Fixed condition that allowed a continuously restarting module to
+	  kill the server under high load with a SIGPIPE (0.9.9b)
+
+	- Fixed compiler bug that caused spurious auto conversion opcodes
+	  to be inserted after parentized subexpressions (0.9.9a)
+
+2004/08/xx - 0.9.9
 
 	- Added Target-Server attribute to radclient which can be used to 
 	  specify one or more server:port/secret combos to be used for the
diff -urN openradius-0.9.9/Rules.mk openradius-0.9.9c/Rules.mk
--- openradius-0.9.9/Rules.mk	Wed Aug 11 16:46:24 2004
+++ openradius-0.9.9c/Rules.mk	Fri Nov 19 14:35:37 2004
@@ -7,7 +7,7 @@
 
 # Standard stuff
 
-VERSION		:= 0.9.9
+VERSION		:= 0.9.9c
 
 .SUFFIXES:
 .SUFFIXES:	.c .o
diff -urN openradius-0.9.9/common/subprocs.c openradius-0.9.9c/common/subprocs.c
--- openradius-0.9.9/common/subprocs.c	Sat Aug  7 21:45:36 2004
+++ openradius-0.9.9c/common/subprocs.c	Fri Nov 19 13:20:42 2004
@@ -409,7 +409,11 @@
 	ssize_t xfered, left;
 
 	/* Write as much as we can. */
-	ring_write(p->w, p->wfd, &xfered, 0);
+	if (ring_write(p->w, p->wfd, &xfered, 0) == RING_IOERR) {
+		msg(F_PROC, L_ERR, "proc_handle_write: Warning: write error from %d - killing it to be sure\n", p->pid);
+		proc_stop(p, t);
+		return;
+	}
 
 	/* If we transfered anything at all, add RECEIVING to our state */
 	p->state |= PRS_RECEIVING;
diff -urN openradius-0.9.9/language/langcompile.c openradius-0.9.9c/language/langcompile.c
--- openradius-0.9.9/language/langcompile.c	Fri Jan  2 11:22:29 2004
+++ openradius-0.9.9c/language/langcompile.c	Fri Nov 19 13:20:37 2004
@@ -394,7 +394,7 @@
 		if (c == '(' && context == NON) {
 			S(1);
 			l = reccompile(m, ifaces, source, &o, bufsize - ret, 0,
-				       req_ctx, ctx_item, &context);
+				       ANY, ctx_item, &context);
 			if (l == -1) return -1;
 			ret += l;
 			continue;
diff -urN openradius-0.9.9/language/langcompile.c.rej openradius-0.9.9c/language/langcompile.c.rej
--- openradius-0.9.9/language/langcompile.c.rej	Thu Jan  1 01:00:00 1970
+++ openradius-0.9.9c/language/langcompile.c.rej	Fri Nov 19 13:20:46 2004
@@ -0,0 +1,17 @@
+***************
+*** 394,400 ****
+  		if (c == '(' && context == NON) {
+  			S(1);
+  			l = reccompile(m, ifaces, source, &o, bufsize - ret, 0,
+- 				       req_ctx, ctx_item, &context);
+  			if (l == -1) return -1;
+  			ret += l;
+  			continue;
+--- 394,400 ----
+  		if (c == '(' && context == NON) {
+  			S(1);
+  			l = reccompile(m, ifaces, source, &o, bufsize - ret, 0,
++ 				       ANY, ctx_item, &context);
+  			if (l == -1) return -1;
+  			ret += l;
+  			continue;
diff -urN openradius-0.9.9/raddb/behaviour openradius-0.9.9c/raddb/behaviour
--- openradius-0.9.9/raddb/behaviour	Sat Aug  7 21:45:36 2004
+++ openradius-0.9.9c/raddb/behaviour	Fri Nov 19 13:33:36 2004
@@ -93,9 +93,20 @@
   # set CHAP-Challenge by copying it from the request authenticator 
   # if we're doing CHAP and it wasn't already there
 
+
   User-Password and (
-    REQ:User-Password := (User-Password ^ md5 (REP:Secret . RAD-Authenticator) .
-			  "\x00") beforefirst "\x00"
+    str = 16 firstof -48 lastof User-Password,
+    str = 16 firstof -32 lastof User-Password,
+    str = 16 firstof -16 lastof User-Password,
+    str = 16 firstof User-Password,
+
+    REQ:User-Password :=
+      	(md5 (REP:Secret . RAD-Authenticator) ^ REQ:str .
+      	 md5 (REP:Secret . REQ:str) ^ (del str, REQ:str) .
+      	 md5 (REP:Secret . REQ:str) ^ (del str, REQ:str) .
+      	 md5 (REP:Secret . REQ:str) ^ (del str, REQ:str) . "\x00") 
+	beforefirst "\x00",
+    del str
   ),
   CHAP-Password and (
     CHAP-Challenge or (REQ:CHAP-Challenge = RAD-Authenticator)
diff -urN openradius-0.9.9/raddb/behaviour.sample-usersfile openradius-0.9.9c/raddb/behaviour.sample-usersfile
--- openradius-0.9.9/raddb/behaviour.sample-usersfile	Mon Aug  9 12:54:47 2004
+++ openradius-0.9.9c/raddb/behaviour.sample-usersfile	Fri Nov 19 13:33:57 2004
@@ -93,9 +93,20 @@
   # set CHAP-Challenge by copying it from the request authenticator 
   # if we're doing CHAP and it wasn't already there
 
+
   User-Password and (
-    REQ:User-Password := (User-Password ^ md5 (REP:Secret . RAD-Authenticator) .
-			  "\x00") beforefirst "\x00"
+    str = 16 firstof -48 lastof User-Password,
+    str = 16 firstof -32 lastof User-Password,
+    str = 16 firstof -16 lastof User-Password,
+    str = 16 firstof User-Password,
+
+    REQ:User-Password :=
+      	(md5 (REP:Secret . RAD-Authenticator) ^ REQ:str .
+      	 md5 (REP:Secret . REQ:str) ^ (del str, REQ:str) .
+      	 md5 (REP:Secret . REQ:str) ^ (del str, REQ:str) .
+      	 md5 (REP:Secret . REQ:str) ^ (del str, REQ:str) . "\x00") 
+	beforefirst "\x00",
+    del str
   ),
   CHAP-Password and (
     CHAP-Challenge or (REQ:CHAP-Challenge = RAD-Authenticator)
diff -urN openradius-0.9.9/server/main.c openradius-0.9.9c/server/main.c
--- openradius-0.9.9/server/main.c	Sat Aug  7 21:45:36 2004
+++ openradius-0.9.9c/server/main.c	Fri Nov 19 13:20:46 2004
@@ -228,11 +228,12 @@
 	sa.sa_flags = SA_NOCLDSTOP + SA_RESTART; sa.sa_handler = sighandler; 
 	sigaction(SIGHUP, &sa, 0); sigaction(SIGINT, &sa, 0);
 	sigaction(SIGQUIT, &sa, 0); sigaction(SIGTERM, &sa, 0);
-	sigaction(SIGCHLD, &sa, 0);
+	sigaction(SIGCHLD, &sa, 0); 
+	sa.sa_handler = SIG_IGN; sigaction(SIGPIPE, &sa, 0); 
 #else
 	signal(SIGHUP, sighandler); signal(SIGINT, sighandler);
 	signal(SIGQUIT, sighandler); signal(SIGTERM, sighandler); 
-	signal(SIGCHLD, sighandler);
+	signal(SIGCHLD, sighandler); signal(SIGPIPE, SIG_IGN);
 #endif
 
 	/* Go to background */
