From: Andrew Bartlett Date: Wed, 17 Jun 2020 20:39:09 +0000 (+1200) Subject: python: Correctly re-raise the LdbError if the embedded error is not ldb.ERR_UNWILLIN... X-Git-Tag: ldb-2.2.0~57 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9513d02ef370bb4d1e56459d403a01a7b4c2ea51;p=thirdparty%2Fsamba.git python: Correctly re-raise the LdbError if the embedded error is not ldb.ERR_UNWILLING_TO_PERFORM The current code attempts a SAMR based password set for all errors, we want to continue on LDAP or local LDB (in the restore case) unless we really got the specific error given by Windows 2000. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14414 Signed-off-by: Andrew Bartlett Reviewed-by: Gary Lockyer Reviewed-by: David Mulder Autobuild-User(master): Gary Lockyer Autobuild-Date(master): Tue Jun 23 05:07:00 UTC 2020 on sn-devel-184 --- diff --git a/python/samba/join.py b/python/samba/join.py index 20cbab4255c..7273f3734d3 100644 --- a/python/samba/join.py +++ b/python/samba/join.py @@ -746,7 +746,7 @@ class DCJoinContext(object): except ldb.LdbError as e2: (num, _) = e2.args if num != ldb.ERR_UNWILLING_TO_PERFORM: - pass + raise ctx.net.set_password(account_name=ctx.samname, domain_name=ctx.domain_name, newpassword=ctx.acct_pass)