[Git][openldap-team/openldap][master] slapd.scripts-common: Avoid double-UTF8-encoding org name

Ryan Tandy (@rtandy) gitlab at salsa.debian.org
Fri Jan 13 23:35:55 GMT 2023



Ryan Tandy pushed to branch master at Debian OpenLDAP Maintainers / openldap


Commits:
c5cae2c6 by Gioele Barabucci at 2023-01-13T23:35:25+00:00
slapd.scripts-common: Avoid double-UTF8-encoding org name

The `postinst` maintscript of slapd incorrectly encodes organization names
with non-ASCII characters.

The issue is that values received from debconf (already in UTF-8) are
encoded once again via the function `encode_utf8`.

This turns

    "pé" (0x70 0xC3 0xA9 = U+0070, U+00E9)

into

    "pé" (0x70 0xC3 0x8e 0xC2 0xA9 = U+0070, U+00C3, U+00A9)

There are two possible scenarios:

1. If one assumes that the string returned by debconf is UTF-8 encoded
(that is the case in all modern setups), then there is no need for
another round of encoding.

2. If instead, one assumes that the string returned by debconf is not
UTF-8 encoded, then one should also know which encoding it is in, in order
to perform the right conversion.

The current code produces wrong results in both cases.

Closes: #1016185

- - - - -


1 changed file:

- debian/slapd.scripts-common


View it on GitLab: https://salsa.debian.org/openldap-team/openldap/-/commit/c5cae2c64dbf39962548bfce423e61e2c2880b05

-- 
View it on GitLab: https://salsa.debian.org/openldap-team/openldap/-/commit/c5cae2c64dbf39962548bfce423e61e2c2880b05
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-openldap-devel/attachments/20230113/5237d9a1/attachment.htm>


More information about the Pkg-openldap-devel mailing list