rlm_rediswho with spaces
Alan DeKok
aland at deployingradius.com
Fri Oct 26 18:03:38 CEST 2012
Brian Candler wrote:
> One commit adds escaping to rediswho_command (rlm_rediswho.c),
Thats already done.
> and the other
> adds de-escaping to rlm_redis_query (rlm_redis.c).
That's probably not the best way to do it.
> It's tested and it's working. The only question I have is, is it OK to chomp
> up the string in-place in rlm_redis_query, or should I strdup it first and
> free it later?
My $0.02 is to do what src/main/exec.c does. Pass the *raw* query
string into rlm_redis_query. It then splits the string into argv, and
calls radius_xlat() on each one. It then passes the argv array to
redisCommand.
> P.S. I copied 'mystrtok' from valuepair.c. I checked around and there are a
> couple of modules which use the standard strtok, which is not re-entrant;
> is it thread-safe?
The standard strtok() is not thread-safe. IIRC, the modules only use
it when instantiating themsevles, which is OK.
Alan DeKok.
More information about the Freeradius-Devel
mailing list