On 2022-06-02, Theo de Raadt wrote:
 But please consider this impact of the change you propose.
> 
>      There is one additional flag, VIS_NOSLASH, which inhibits the doubling of
>      backslashes and the backslash before the default format (that is, control
>      characters are represented by `^C' and meta characters as `M-C').  With
>      this flag set, the encoding is ambiguous and non-invertible.
>                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> This means if syslog is used to send some 'binary data', and you later on
> want to decode meaning "unvis" the block, that won't work.  Is that a usage
> case to worry about?

I think not. If you intentionally store binary data in syslog (why?) you can use
base64. The vis call is to prevent harm, not guarantee it's unambiguous.
Lots of potential syslog calls are already ambiguous if the user provides
inputs containing spaces. A structured format like json seems like the right 
thing, so it'd be nice if syslog didn't interfere.

At least when I looked at a similar problem recently, I cared about censoring
the control characters, but not recovering them.

Reply via email to