python: Correctly re-raise the LdbError if the embedded error is not ldb.ERR_UNWILLIN...
authorAndrew Bartlett <abartlet@samba.org>
Wed, 17 Jun 2020 20:39:09 +0000 (08:39 +1200)
committerGary Lockyer <gary@samba.org>
Tue, 23 Jun 2020 05:07:00 +0000 (05:07 +0000)
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 <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: David Mulder <dmulder@suse.com>
Autobuild-User(master): Gary Lockyer <gary@samba.org>
Autobuild-Date(master): Tue Jun 23 05:07:00 UTC 2020 on sn-devel-184

python/samba/join.py

index 20cbab4255c866d61960a1c35df456bf0b91cec1..7273f3734d3e6cc97b364559ab62b3bffc9e4ff8 100644 (file)
@@ -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)