summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamen Mazdrashki <kamenim@samba.org>2010-04-11 17:27:30 +0300
committerKamen Mazdrashki <kamenim@samba.org>2010-04-12 01:50:39 +0300
commita62d0419dee3d3fe8618baa71aa882c5bed54072 (patch)
tree99f7e2767284e876d604d9b80a55f5709c263ff3
parentcb0ad42a3d9d837cfc06f65baa6d8fa2d28a3ec9 (diff)
downloadsamba-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!
-rw-r--r--source4/libnet/libnet_become_dc.c7
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,