diff options
author | Matthias Dieter Wallnöfer <mdw@samba.org> | 2011-11-09 09:32:55 +0100 |
---|---|---|
committer | Matthias Dieter Wallnöfer <mdw@samba.org> | 2011-11-09 23:37:08 +0100 |
commit | f4a07f0b819b1fb669e436f91c34e61d0ec8ff92 (patch) | |
tree | a2969331aff3b469589a38f57d14758caefaf0a9 /source4/scripting | |
parent | c49fc5264b61ff2e8aa1f9ff11187ea3379f0bf2 (diff) | |
download | samba-f4a07f0b819b1fb669e436f91c34e61d0ec8ff92.tar.gz samba-f4a07f0b819b1fb669e436f91c34e61d0ec8ff92.tar.bz2 samba-f4a07f0b819b1fb669e436f91c34e61d0ec8ff92.zip |
s4:join.py - fix up "DsAddEntry" against Windows Server 2000
It is important to consider the result level regarding error
information. Windows 2000 seems to send us back v2, all other
implementations v3. Consider post "Joining W2k AD domain"
Reviewed-by: abartlet
Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Wed Nov 9 23:37:08 CET 2011 on sn-devel-104
Diffstat (limited to 'source4/scripting')
-rw-r--r-- | source4/scripting/python/samba/join.py | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/source4/scripting/python/samba/join.py b/source4/scripting/python/samba/join.py index 7ce53442a4..96b07a6fbf 100644 --- a/source4/scripting/python/samba/join.py +++ b/source4/scripting/python/samba/join.py @@ -363,15 +363,24 @@ class dc_join(object): prev = o (level, ctr) = ctx.drsuapi.DsAddEntry(ctx.drsuapi_handle, 2, req2) - if ctr.err_ver != 1: - raise RuntimeError("expected err_ver 1, got %u" % ctr.err_ver) - if ctr.err_data.status != (0, 'WERR_OK'): - print("DsAddEntry failed with status %s info %s" % (ctr.err_data.status, - ctr.err_data.info.extended_err)) - raise RuntimeError("DsAddEntry failed") - if ctr.err_data.dir_err != drsuapi.DRSUAPI_DIRERR_OK: - print("DsAddEntry failed with dir_err %u" % ctr.err_data.dir_err) - raise RuntimeError("DsAddEntry failed") + if level == 2: + if ctr.dir_err != drsuapi.DRSUAPI_DIRERR_OK: + print("DsAddEntry failed with dir_err %u" % ctr.dir_err) + raise RuntimeError("DsAddEntry failed") + if ctr.extended_err != (0, 'WERR_OK'): + print("DsAddEntry failed with status %s info %s" % (ctr.extended_err)) + raise RuntimeError("DsAddEntry failed") + if level == 3: + if ctr.err_ver != 1: + raise RuntimeError("expected err_ver 1, got %u" % ctr.err_ver) + if ctr.err_data.status != (0, 'WERR_OK'): + print("DsAddEntry failed with status %s info %s" % (ctr.err_data.status, + ctr.err_data.info.extended_err)) + raise RuntimeError("DsAddEntry failed") + if ctr.err_data.dir_err != drsuapi.DRSUAPI_DIRERR_OK: + print("DsAddEntry failed with dir_err %u" % ctr.err_data.dir_err) + raise RuntimeError("DsAddEntry failed") + return ctr.objects def join_add_ntdsdsa(ctx): |