[Samba] Accentuated characters issue when receiving attributes from "samba user syncpasswords"

Lapin Blanc fabien.toune at lapin-blanc.com
Thu Mar 29 18:17:43 UTC 2018


Thank you again for your advice. You were right, much easier to use a
parser.
I just had to find a light one, because python-ldap is so heavy, and need
to be compiled.
I found https://pypi.python.org/pypi/ldif3 which is perfect for the job.

Cheers,

Fabien Toune


2018-03-28 19:43 GMT+02:00 Andrew Bartlett via samba <samba at lists.samba.org>
:

> On Wed, 2018-03-28 at 16:06 +0200, Reindl Harald via samba wrote:
> >
> > Am 28.03.2018 um 15:52 schrieb Lapin Blanc via samba:
> > > I receive stdin input from "samba user syncpasswords" in my python
> script.
> > > The user is created with ' Active Directory Users and Computers', and
> have
> > > some accentuated characters in their givenName and/or familyName (sn)
> > > When parsing the diff, the CN reads of, but weird characters appears
> in the
> > > attributes instead of the right name :
> > >
> > > INFO:root:DN found: CN=Arsène Lupin,CN=Users,DC=educonsult,DC=intra
> > > INFO:root:Attribute found: cn: = QXJzw6huZSBMdXBpbg==
> > > INFO:root:Attribute found: sn = Lupin
> > > INFO:root:Attribute found: givenName: = QXJzw6huZQ==
> > > INFO:root:Attribute found: displayName: = QXJzw6huZSBMdXBpbg==
> > > INFO:root:Attribute found: name: = QXJzw6huZSBMdXBpbg==
> > > INFO:root:Attribute found: objectGUID = c20847ee-963b-4d70-9c5c-
> a4e5458745f4
> > > INFO:root:Attribute found: objectSid =
> > > S-1-5-21-1504766521-268068577-265870750-1120
> > > INFO:root:Attribute found: sAMAccountName = arsene.lupin
> > >
> > > When using regular characters, everything is fine
> >
> > there is nothing weird
> >
> > php > echo base64_decode('QXJzw6huZSBMdXBpbg==');
> > Arsène Lupin
>
> This is correct.  The :: in the LDIF indicates that the value is base-
> 64 encoded, possibly over multiple lines (just as normal strings can be
> over multiple lines).  We try and honour that RFC.
>
> Ideally parse it with an LDIF parser.
>
> Andrew Bartlett
>
> --
> Andrew Bartlett                       http://samba.org/~abartlet/
> Authentication Developer, Samba Team  http://samba.org
> Samba Developer, Catalyst IT          http://catalyst.net.nz/
> services/samba
>
>
> --
> To unsubscribe from this list go to the following URL and read the
> instructions:  https://lists.samba.org/mailman/options/samba
>


More information about the samba mailing list