Hello Bjorn,

Thursday, March 28, 2002, 9:26:04 PM, you wrote:

BN> I am using rlm_dbm with increasing success. :) However I recently ran
BN> into a problem; for some reason, rlm_dbm seems to compare the username
BN> of a request with the password of an entry:

BN>     Ready to process requests.
BN>     rad_recv: Access-Request packet from host 127.0.0.1:58048, id=192, length=108
BN>         User-Name = "test1"
BN>         CHAP-Password = 0xc06cde1289e2860d28c71eb190aad0b4e3
BN>         NAS-IP-Address = 130.67.10.1
BN>         NAS-Port-Id = "0"
BN>         NAS-Port-Type = Async
BN>         Service-Type = Framed-User
BN>         Framed-Protocol = PPP
BN>         Calling-Station-Id = "22332211"
BN>         Called-Station-Id = "153381007007"
BN>         Acct-Session-Id = "379094840"
BN>     modcall: entering group authorize
BN>       modcall[authorize]: module "suffix" returns ok
BN>       modcall[authorize]: module "files" returns notfound
BN>     rlm_dbm: try open database file: /home/b/bn/radius/raddb/users.db 
BN>     rlm_dbm: Call parse_user: 
BN>     sm_parse_user.c: check for loops
BN>     Add test1 to user list
BN>     sm_parse_user: start parsing: user: test1
BN> *   parse buffer: <<Password == "1test", User-Category == "isdnuser">> 
BN> *   rlm_dbm: recod parsed 
BN> *   comparing request pattern test1 of type 1 to 1test
BN> *   rlm_dbm: patern not matched, reply skiped
BN>     Remove test1 from user list
BN>     sm_parse_user.c: check for loops
BN>     Add DEFAULT to user list
BN>     rlm_dbm: User <DEFAULT> not foud in database 
BN>     Remove DEFAULT from user list
BN>       modcall[authorize]: module "dbm" returns notfound
BN>     modcall: group authorize returns ok
BN>     auth: No Auth-Type configuration for the request, rejecting the user
BN>     auth: Failed to validate the user.
BN>     Delaying request 0 for 1 seconds
BN>     Finished request 0
    
BN> The problem occurs, as far as I can determine, in the four lines marked
BN> with a "*". Especially note the line where it says it's comparing "test1"
BN> to "1test"; "test1" is the username, "1test" is the password. This is a
BN> dump of the user database:

BN> ducati(bn) radius 363$ bin/rlm_dbm_cat -f raddb/users.db
BN> isdnuser            Auth-Type := Local, Called-Station-Id !~ "^1533"
                    
                    
BN> prfxti              Auth-Type := Local, Called-Station-Id =~ "^1533"
                    
                    
BN> test1               Password == "1test", User-Category == "isdnuser"
BN>                     Reply-Message = "Login ok"
                    
BN> ducati(bn) radius 364$ 

BN> I'm working my way through the code, but if someone has a hint, they
BN> will save me hours of cursing. :-)

the paircmp function used to compare. I
May be it is deprecated now ?
it interface was changed
see:
cvs diff -r 1.1  -r 1.2 rlm_dbm.c


 case T_EOL:     DEBUG2("rlm_dbm: recod parsed\n"); /* vpcontains full pair list */
    if ( parse_state == SMP_PATTERN ) { /* pattern line found */
    DEBUG2("process pattern");
    /* check pattern against request */
    if ( paircmp(NULL, request, vp, reply ) == 0 ) {
        DEBUG2("rlm_dbm: Pattern matched, look for request");
        pairmove(&tmp_config, &vp);
        pairfree(&vp);
        parse_state = SMP_REPLY;
         /* look for reply */
    } else  {
         /* skip reply */
         DEBUG2("rlm_dbm: paternnot matched, reply skiped");


-- 
Andrei Koulik.
System administrator, Sandy Info Ltd. (ISP), Nizhny Novgorod, Russia


- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Reply via email to