Gabriel Blanchard gabriel at teksavvy.com
Wed Jan 21 03:04:36 CET 2009

I was just trying to implement a buffered-sql server (type detail)  
using the FreeBSD port 2.1.3 and it was only passing on the first SQL  
query and any consecutive query would be left out.

I found an old thread in the freeradius archive regarding this and you  
pointed this out (Alan)

Copy pasting..

 >  It looks like it isn't noticing that it's finished reading the file.
 >  I would suggest going to line 482 of src/main/detail.c, and adding a
 >new line:
 >		data->state = STATE_HEADER;
 >		if (feof(data->fp) goto cleanup; // added line
 >		return 0;
 >  If that fixes it, I'll commit it to CVS.  if not then the issue is a
 > little more complicated.
 >  The good news is that 2.0 now has the skeleton of a regression test
 >suite in src/tests.  So adding an automated test for this case  
should be
 >relatively straightforward.

and there was no follow up after it....so I tried it and it appears to  
work. Now I realize that your latest GIT isn't the same at all from  
what I can see and honestly I don't really have the time to look at  
it. Anyway this patch appears to fix the issue on 2.1.3

--- src/main/detail.c	2009-01-20 20:32:05.000000000 -0500
+++ src/main/detail.c	2009-01-20 20:32:27.000000000 -0500
@@ -579,6 +579,7 @@
  	if (!data->vps) {
  		data->state = STATE_HEADER;
+		if (feof(data->fp)) goto cleanup;
  		return 0;

Unless someone may think that this will cause an issue, I'll be using  
it on my radius servers for now...


More information about the Freeradius-Devel mailing list