Re: User-Name containing an empty string.
"Georges Arnould" <[email protected]>
| Newsgroups | gmane.comp.gnu.radius.general |
|---|---|
| Message-ID | <014901c4d39c$079dfd90$6c16a8c0@winbebert> |
He he ! Many thanks Sergey, this is a cleanest way to do it than mine ! Would you include this patch in the next release on Gnu-radius so that I can count on the "feature" ? Last question : was there any goal into calling hints_setup() after the user_name check or not ? Many thanks ! Georges ----- Original Message ----- From: "Sergey Poznyakoff" <[email protected]> To: "Georges Arnould" <[email protected]> Cc: <[email protected]> Sent: Friday, November 26, 2004 9:48 AM Subject: Re: [Help-gnu-radius] User-Name containing an empty string. > Georges Arnould <[email protected]> wrote: > > > Once my patch finished, I wondered if there was another and smartier way > > to force radiusd to send a Access-Accept answer for null User-Name. > > > > Any idea for me ? > > Well, the best way would be to apply the following patch to > radiusd/radius.c: > > Index: radiusd/radius.c > =================================================================== > RCS file: /cvsroot/radius/radius/radiusd/radius.c,v > retrieving revision 1.77 > diff -p -u -r1.77 radius.c > --- radiusd/radius.c 2 Nov 2004 08:55:39 -0000 1.77 > +++ radiusd/radius.c 26 Nov 2004 08:48:12 -0000 > @@ -473,13 +473,13 @@ radius_respond(REQUEST *req) > > radiusd_sql_clear_cache(); > > + /* Add any specific attributes for this username. */ > + hints_setup(radreq); > + > if (radreq->request->code == RT_ACCESS_REQUEST > && rad_auth_check_username(radreq, req->fd)) > return 1; > > - /* Add any specific attributes for this username. */ > - hints_setup(radreq); > - > /* Check if we support this request */ > switch (radreq->request->code) { > case RT_ACCESS_REQUEST: > > > and then to use the following rewrite function: > > integer > fake_name() > { > if (!*%[User-Name] || User-Name = "") > %[User-Name] = "fake-user-name"; > return 0; > } > > Regards, > Sergey >