Re: User-Name containing an empty string.

Sergey Poznyakoff <[email protected]>
Newsgroups gmane.comp.gnu.radius.general
Organization Farlep-Internet
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.