Dict protocol changes string
Aki Tuomi
aki.tuomi at dovecot.fi
Fri Sep 23 06:05:28 UTC 2016
On 29.07.2016 15:35, Nagy, Attila wrote:
> Hi,
>
> I use pass and userdb with dict protocol in a similar way:
>
> key passdb {
> key = passdb^MAuth-User: %u^MAuth-Pass: %w^MAuth-Protocol:
> %s^MClient-IP: %r
> format = json
> }
>
> (^M is an \r character, inserted with vi CTRL-v + enter)
>
> Until 2.2.24 this has worked, but 2.2.25 seems to convert that ASCII
> 13 into an ASCII 1 and an "r".
>
> Python printout from what I get with 2.2.25:
>
> 'Lshared/passdb\x01rAuth-User: user\x01rAuth-Pass:
> pass\x01rAuth-Protocol: pop3\x01rClient-IP: 1.2.3.4'
>
> Is this change intentional? Why?
Hi!
Dict protocol escapes you newlines. You are expected to de-escape them
yourself.
Following escapes are done, you can de-escape them with your client.
\x00 => \x10
\x01 => \x11
\t => \x1t
\r => \x1r
\n => \x1n
The change has been made to avoid breakage if newlines or NULLs are
injected into the data.
Aki
More information about the dovecot
mailing list