auth/credentials: PY3 set_password should decode from unicode 'utf8'
commit9b18748c703593a3c257c47b626966b0bd6caa3f
authorNoel Power <noel.power@suse.com>
Thu, 8 Nov 2018 15:03:52 +0000 (8 15:03 +0000)
committerNoel Power <npower@samba.org>
Mon, 10 Dec 2018 09:38:21 +0000 (10 10:38 +0100)
treea7f8ea4076fd90d1b5a8ccb10e7b8ba2ea06bff0
parent8b10c7137165c3da10f908c250c0a59d4cca821b
auth/credentials: PY3 set_password should decode from unicode 'utf8'

set_password processes input using ParseTuple with "s" format, this
accepts string or unicode but...

Some py2 code is incorrectly using code like

   credentials.set_password(pass.encode('utf8'))

however that won't work in PY3. We should just make sure the string
retrieved from unicode passed in is encoded with 'utf8'
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
auth/credentials/pycredentials.c