diff options
author | Kamen Mazdrashki <kamenim@samba.org> | 2010-04-11 17:27:30 +0300 |
---|---|---|
committer | Kamen Mazdrashki <kamenim@samba.org> | 2010-04-12 01:50:39 +0300 |
commit | a62d0419dee3d3fe8618baa71aa882c5bed54072 (patch) | |
tree | 99f7e2767284e876d604d9b80a55f5709c263ff3 /source4/libnet | |
parent | cb0ad42a3d9d837cfc06f65baa6d8fa2d28a3ec9 (diff) | |
download | samba-a62d0419dee3d3fe8618baa71aa882c5bed54072.tar.gz samba-a62d0419dee3d3fe8618baa71aa882c5bed54072.tar.bz2 samba-a62d0419dee3d3fe8618baa71aa882c5bed54072.zip |
s4/libnet: handle errors returned for DsAddEntry_v3 properly
It turns out ms-docs are little bit misleading - in case of
no error, r->out.ctr->ctr3.err_data is not NULL, but
error information (r->out.ctr->ctr3.err_data->v1.info) is NULL!
Diffstat (limited to 'source4/libnet')
-rw-r--r-- | source4/libnet/libnet_become_dc.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/source4/libnet/libnet_become_dc.c b/source4/libnet/libnet_become_dc.c index dcd65812d4..486416e1bd 100644 --- a/source4/libnet/libnet_become_dc.c +++ b/source4/libnet/libnet_become_dc.c @@ -2285,11 +2285,12 @@ static void becomeDC_drsuapi1_add_entry_recv(struct tevent_req *subreq) } if (*r->out.level_out == 3) { + WERROR status; union drsuapi_DsAddEntry_ErrData *err_data = r->out.ctr->ctr3.err_data; /* check for errors */ - if (err_data) { - WERROR status; + status = err_data ? err_data->v1.status : WERR_OK; + if (!W_ERROR_IS_OK(status)) { struct drsuapi_DsAddEntryErrorInfo_Attr_V1 *attr_err; struct drsuapi_DsAddEntry_AttrErrListItem_V1 *attr_err_li; struct drsuapi_DsAddEntryErrorInfo_Name_V1 *name_err; @@ -2301,8 +2302,6 @@ static void becomeDC_drsuapi1_add_entry_recv(struct tevent_req *subreq) return; } - status = err_data->v1.status; - DEBUG(0,("DsAddEntry (R3) failed: " "Errors: dir_err = %d, status = %s;\n", err_data->v1.dir_err, |