On 17 Apr 2015, at 08:00, Chaigneau, Nicolas <nicolas.chaigneau@capgemini.com> wrote:
I'm using 3.0.x with linelog module, with a filename set up as follows:
filename=${logdir}/RadiusTrace-%{Client-Shortname}-%Y%m%d%H.log
In clients.conf I have some clients which contain "-" characters. When the linelog creates the output file, the "-" are doubled (resulting in "--" in the file name).
(This is done in function rad_filename_escape from main\util.c)
Is there a way to prevent this ?
The escape function produces POSIX fully portable filenames, whilst allowing recovery of the input text.
It should be possible to modify the escape functions so that hyphen doesn't have another hyphen to escape it, unless the hyphen in the src string was before a disallowed character.
Thinking about it, that's probably a good idea.
Can this be considered a bug so it can be done in 3.0.x ? :)
Alternatively, rlm_detail provides a parameter (escape_filenames) that allows to disable the escaping.
Maybe this could be a good idea to do this also for rlm_linelog.
Yeah, that's a better idea. The escape function needs to prevent collisions from occurring, so hyphens need to be escaped. I've added the same config_item as rlm_detail, which defaults to off. The behaviour should be almost the same as 3.0.7, except now it'll prevent upwards directory traversal and do something sensible with control chars. -Arran Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS development team FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2