[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freeradius-devel
Subject:    Re: please document SQL-User-Name xlat option in sql-log module
From:       Nicolas Baradakis <nbk () sitadelle ! com>
Date:       2007-11-29 23:35:21
Message-ID: 20071129233521.GJ25625 () asuka ! dae ! sitadelle ! com
[Download RAW message or body]

Stefan Winter wrote:

> rlm_sql_log has an option record
> 
>         {"sql_user_name", PW_TYPE_STRING_PTR,
>          offsetof(rlm_sql_log_t,sql_user_name), NULL, ""},
> 
> This is not documented in the config file. I tried to use %{SQL-User-Name}
> in my relay config, didn't know of this option's existence, so it was
> assumed to be NULL.

What is the problem then? If you don't set the option "sql_user_name"
rlm_sql_log doesn't create a "SQL-User-Name" pair. This is the same
as rlm_sql.

> The code then doesn't translate User-Name at all, and my variable subst 
> created INSERT strings with an empty user name. 

I'm not sure what you mean by that. rlm_sql_log expands %{User-Name} to
the username passed from the client, not an empty string.

> I suggest just copying the text from sql.conf, as the semantics seems to be 
> the same:
> 
> [...]

Indeed it is the same as rlm_sql, therefore I'm not sure there is really
a need to duplicate the whole description.

I think adding one line with an example will be enough, so you can notice
its existence.

	sql_log {
		path = ${radacctdir}/sql-relay
		acct_table = "radacct"
		postauth_table = "radpostauth"
		sql_user_name = %{%{User-Name}:-DEFAULT}}
		...
	}

-- 
Nicolas Baradakis

-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/devel.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic