s4:libnet: make use of dcerpc_binding_set_flags()
authorStefan Metzmacher <metze@samba.org>
Tue, 4 Feb 2014 08:57:07 +0000 (09:57 +0100)
committerGünther Deschner <gd@samba.org>
Thu, 13 Feb 2014 10:54:16 +0000 (11:54 +0100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
source4/libnet/libnet_become_dc.c
source4/libnet/libnet_rpc.c
source4/libnet/libnet_unbecome_dc.c

index 7116c36f48926b5680d11a32bead558c8828f8bf..9422172f6932ba402d36a970d58fa4401df15996 100644 (file)
@@ -1583,7 +1583,10 @@ static void becomeDC_drsuapi_connect_send(struct libnet_BecomeDC_state *s,
        }
 
        if (DEBUGLEVEL >= 10) {
-               drsuapi->binding->flags |= DCERPC_DEBUG_PRINT_BOTH;
+               c->status = dcerpc_binding_set_flags(drsuapi->binding,
+                                                    DCERPC_DEBUG_PRINT_BOTH,
+                                                    0);
+               if (!composite_is_ok(c)) return;
        }
 
        creq = dcerpc_pipe_connect_b_send(s, drsuapi->binding, &ndr_table_drsuapi,
@@ -2458,7 +2461,10 @@ static void becomeDC_drsuapi1_add_entry_recv(struct tevent_req *subreq)
        if (!composite_is_ok(c)) return;
 
        if (DEBUGLEVEL >= 10) {
-               s->drsuapi2.binding->flags |= DCERPC_DEBUG_PRINT_BOTH;
+               c->status = dcerpc_binding_set_flags(s->drsuapi2.binding,
+                                                    DCERPC_DEBUG_PRINT_BOTH,
+                                                    0);
+               if (!composite_is_ok(c)) return;
        }
 
        /* w2k3 uses the same assoc_group_id as on the first connection, so we do */
@@ -2532,7 +2538,10 @@ static void becomeDC_drsuapi2_bind_recv(struct tevent_req *subreq)
        if (!composite_is_ok(c)) return;
 
        if (DEBUGLEVEL >= 10) {
-               s->drsuapi3.binding->flags |= DCERPC_DEBUG_PRINT_BOTH;
+               c->status = dcerpc_binding_set_flags(s->drsuapi3.binding,
+                                                    DCERPC_DEBUG_PRINT_BOTH,
+                                                    0);
+               if (!composite_is_ok(c)) return;
        }
 
        /* w2k3 uses the same assoc_group_id as on the first connection, so we do */
@@ -2540,7 +2549,10 @@ static void becomeDC_drsuapi2_bind_recv(struct tevent_req *subreq)
        c->status = dcerpc_binding_set_assoc_group_id(s->drsuapi3.binding, assoc_group_id);
        if (!composite_is_ok(c)) return;
        /* w2k3 uses the concurrent multiplex feature on the 3rd connection, so we do */
-       s->drsuapi3.binding->flags              |= DCERPC_CONCURRENT_MULTIPLEX;
+       c->status = dcerpc_binding_set_flags(s->drsuapi3.binding,
+                                            DCERPC_CONCURRENT_MULTIPLEX,
+                                            0);
+       if (!composite_is_ok(c)) return;
 
        becomeDC_drsuapi_connect_send(s, &s->drsuapi3, becomeDC_drsuapi3_connect_recv);
 }
index 2ff4a38a5fa20c15ff2902d53d9659bb9527ada3..db48ea3f7dbdd9c8c4103dd37fb0c9489bd7e94e 100644 (file)
@@ -108,7 +108,8 @@ static struct composite_context* libnet_RpcConnectSrv_send(struct libnet_context
        switch (r->level) {
        case LIBNET_RPC_CONNECT_SERVER:
        case LIBNET_RPC_CONNECT_SERVER_ADDRESS:
-               b->flags = r->in.dcerpc_flags;
+               c->status = dcerpc_binding_set_flags(b, r->in.dcerpc_flags, 0);
+               if (!composite_is_ok(c)) return c;
                break;
        default:
                /* other types have already been checked before */
@@ -116,7 +117,8 @@ static struct composite_context* libnet_RpcConnectSrv_send(struct libnet_context
        }
 
        if (DEBUGLEVEL >= 10) {
-               b->flags |= DCERPC_DEBUG_PRINT_BOTH;
+               c->status = dcerpc_binding_set_flags(b, DCERPC_DEBUG_PRINT_BOTH, 0);
+               if (!composite_is_ok(c)) return c;
        }
 
        if (r->level == LIBNET_RPC_CONNECT_SERVER_ADDRESS) {
index a46d1433bc6f69a33563b0919b151ebd773485e1..b0fe07b0d746536a785c38d3955a0e8d56bd2b94 100644 (file)
@@ -551,7 +551,10 @@ static void unbecomeDC_drsuapi_connect_send(struct libnet_UnbecomeDC_state *s)
        if (!composite_is_ok(c)) return;
 
        if (DEBUGLEVEL >= 10) {
-               s->drsuapi.binding->flags |= DCERPC_DEBUG_PRINT_BOTH;
+               c->status = dcerpc_binding_set_flags(s->drsuapi.binding,
+                                                    DCERPC_DEBUG_PRINT_BOTH,
+                                                    0);
+               if (!composite_is_ok(c)) return;
        }
 
        creq = dcerpc_pipe_connect_b_send(s, s->drsuapi.binding, &ndr_table_drsuapi,