s4:librpc: add auth_type=ncalrpc_as_system as binding option
authorStefan Metzmacher <metze@samba.org>
Mon, 26 Jan 2015 15:02:20 +0000 (16:02 +0100)
committerGünther Deschner <gd@samba.org>
Thu, 12 Mar 2015 16:13:43 +0000 (17:13 +0100)
In future we may want another way to trigger this,
but our current rpc libraries need a lot of cleanup before.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
source4/librpc/rpc/dcerpc_util.c

index de960b246be53102a210861fd371a6cf0149ce49..ff3e60ef9bb38cbd0e549c3b7cb6feddd02e4876 100644 (file)
@@ -630,6 +630,22 @@ struct composite_context *dcerpc_pipe_auth_send(struct dcerpc_pipe *p,
                conn->flags |= DCERPC_DEBUG_PRINT_BOTH;
        }
 
+       if (conn->transport.transport == NCALRPC) {
+               const char *v = dcerpc_binding_get_string_option(binding,
+                                                       "auth_type");
+
+               if (v != NULL && strcmp(v, "ncalrpc_as_system") == 0) {
+                       auth_req = dcerpc_bind_auth_send(c, s->pipe, s->table,
+                                                s->credentials,
+                                                lpcfg_gensec_settings(c, s->lp_ctx),
+                                                DCERPC_AUTH_TYPE_NCALRPC_AS_SYSTEM,
+                                                DCERPC_AUTH_LEVEL_CONNECT,
+                                                s->table->authservices->names[0]);
+                       composite_continue(c, auth_req, continue_auth, c);
+                       return c;
+               }
+       }
+
        if (cli_credentials_is_anonymous(s->credentials)) {
                auth_none_req = dcerpc_bind_auth_none_send(c, s->pipe, s->table);
                composite_continue(c, auth_none_req, continue_auth_none, c);