Logging non ASCII strings with rlm_linelog (question + bug report)
Chaigneau, Nicolas
nicolas.chaigneau at capgemini.com
Thu Apr 3 15:29:32 CEST 2014
Hello,
I've tried to use rlm_linelog module to log attributes which contain UTF-8, but it doesn't work as I expected.
In the output, I've got lots of "\377" (0xFF in octal), which are actually octets part of multi-byte characters.
The problem is in function linelog_escape_func from rlm_linelog.c.
>From what I understand, this function works with ASCII strings (single-byte characters), but not with UTF-8.
Is this behaviour on purpose, or has logging of UTF-8 strings been overlooked ?
In any case, there is a bug at line 179 of rlm_linelog.c (in branch 3.0.x):
snprintf(out, outlen, "\\%03o", *in);
Should be something like:
snprintf(out, outlen, "\\%03o", (unsigned char)*in);
Otherwise we get, for example, "\377\377" instead of "\303\250".
I'll log the bug on the issue tracker.
This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
More information about the Freeradius-Users
mailing list