add quote to User-Name

Dudás Péter peter.pdudas at gmail.com
Sat May 6 21:27:09 CEST 2017


Hi Alan!

It is a way too complicated for the first sight.

It is Windows based FreeRadius (2.2.10). And user names has a space between
the First and Last Name, so needed to be double quoted otherwise it is
handled as 2 parameters.
(according to my knowledge it is not possible to insert a double quote
between the \" \" sequence which is not deleted by the command interpreter).

exec multiotp {
        wait = yes
        input_pairs = request
        output_pairs = reply
        program = "../../multiotp.exe -base-dir=C:/mutiotp/ -keep-local
-log -debug \"%{Tmp-String-0}\" \"%{User-Password}\""
        shell_escape = yes
}

Even if I change the User name to a Tmp_String-0 like this the output is
always the user name without the double quotes:
update request {
Tmp-String-0 := "%{User-Name}"
        }

In worst case I'll do the authorization from a small python script where
I'll be able to call the multiotp.exe with the properly quoted user name.

update control {
Auth-Type := `c:\Python27\python.exe freeauth.py %{User-Name}
%{User-Password}`
}

This is just an experiment - not so important. The main auth server is
3.0.13 - where there is no problem calling the multiotp with user names
containing space.
I presume the 4.0 cannot be compiled on windows.

Thank you!

On 6 May 2017 at 20:54, Alan DeKok <aland at deployingradius.com> wrote:

> On May 6, 2017, at 12:48 PM, Dudás Péter <peter.pdudas at gmail.com> wrote:
> >
> > for running external script I have to quote the content of the User-Name
> > (via the Exec module).
> > So in case User-Name is John Doe (received from NPS) I want to have  it
> > like "John Doe".
> >
> > Tried:
> >   User-Name := "%{User-Name}"   # this is not working.
> >
> > Is there a way to do this?
>
>   Don't edit the User-Name in FreeRADIUS.  Instead, change the User-Name
> passed to the script.
>
>   Execute the program as:
>
>         /path/to/progran \"%{User-Name}\"
>
>   But saying what you've tried (NOT just one line), and providing the
> debug log would be useful, too.
>
>  Alan DeKok.
>
>
> -
> List info/subscribe/unsubscribe? See http://www.freeradius.org/
> list/users.html


More information about the Freeradius-Users mailing list