PATCH: rlm_dbm_parser and empty check-items
Gabriel L. Somlo
somlo at cmu.edu
Thu Jul 27 22:56:01 CEST 2006
Hi,
I'm trying to use rlm_dbm for authorization, and discovered that the
rlm_dbm_parser program won't allow an entry to have an empty
check-items list. You can't have, for instance:
foo ;
;
or
foo
;
You must have
foo some_junk == here
;
if foo is to be added to the resulting users.dbm database.
To be more precise, you can't have empty check-items AND empty
reply-items, which I think one should be allowed to have... :)
The attached patch fixes that, and allows rlm_dbm_parser to process
a source file with empty check- and reply-items.
I created the patch against the latest cvs snapshot (jul. 27).
Please apply, or let me know why you think it's a bad idea... :)
Thanks,
Gabriel
-------------- next part --------------
diff -NarU5 freeradius.orig/src/modules/rlm_dbm/rlm_dbm_parser.c freeradius/src/modules/rlm_dbm/rlm_dbm_parser.c
--- freeradius.orig/src/modules/rlm_dbm/rlm_dbm_parser.c 2004-02-26 14:04:28.000000000 -0500
+++ freeradius/src/modules/rlm_dbm/rlm_dbm_parser.c 2006-07-27 15:49:27.000000000 -0400
@@ -153,11 +153,11 @@
static int storecontent (const char * username) {
datum d,k;
int res;
- if ( pdb == NULL || concntr < 3 ) return 1;
+ if ( pdb == NULL || concntr < 2 ) return 1;
DOUT2("store:\n%s\ncontent:\n%s",username,content);
d.dptr = content;
d.dsize = concntr + 1;
More information about the Freeradius-Users
mailing list