Little Patch: Line too long error in config parser
i everyone, this morning I came accross the errror message "Line too long". Turned out I was missing a \n character in the last line of my radiusd.conf. I took a look at the configuration parser, and came up with the following patch. I found the error message to be somewhat un-neccessary. Of course, I admit, it was not much hassle to fix the configuration file, either. With this patch, the config-file will be parsed. And everything is working, as intended. Please consider this patch. regards, Patrick Sudowe Netzbetrieb (Network Operation Center) RWTH Aachen University, Center for Computing and Communication Wendlingweg 10, 52074 Aachen (Germany) -1.1.6/src/main/conffile.c 2007-04-08 00:28:17.000000000 +0200 +++ freeradius-1.1.6_fixed/src/main/conffile.c 2007-06-14 11:51:58.000000000 +0200 @@ -668,15 +668,21 @@ len = strlen(cbuf); + /* * We've filled the buffer, and there isn't * a CR in it. Die! */ if (cbuf[len - 1] != '\n') { - radlog(L_ERR, "%s[%d]: Line too long", - cf, *lineno); - cf_section_free(&cs); - return NULL; + if(eof && (len > 0) && (len < sizeof(buf))) { + cbuf[len] = '\n'; + } + else { + radlog(L_ERR, "%s[%d]: Line too long", + cf, *lineno); + cf_section_free(&cs); + return NULL; + } } /*
participants (1)
-
Patrick Sudowe