s4:rpc_server: remove the old dcesrv_handle_{new,fetch}() api
authorStefan Metzmacher <metze@samba.org>
Thu, 8 Nov 2018 11:20:44 +0000 (12:20 +0100)
committerJeremy Allison <jra@samba.org>
Sat, 12 Jan 2019 02:13:35 +0000 (03:13 +0100)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source4/rpc_server/dcerpc_server.h
source4/rpc_server/handles.c

index ba14ab8..7923d3b 100644 (file)
@@ -427,15 +427,9 @@ NTSTATUS dcesrv_init_context(TALLOC_CTX *mem_ctx,
                                      const char **endpoint_servers, struct dcesrv_context **_dce_ctx);
 
 NTSTATUS dcesrv_reply(struct dcesrv_call_state *call);
-struct dcesrv_handle *dcesrv_handle_new(struct dcesrv_connection_context *context, 
-                                       uint8_t handle_type);
 struct dcesrv_handle *dcesrv_handle_create(struct dcesrv_call_state *call,
                                           uint8_t handle_type);
 
-struct dcesrv_handle *dcesrv_handle_fetch(
-                                         struct dcesrv_connection_context *context, 
-                                         const struct policy_handle *p,
-                                         uint8_t handle_type);
 struct dcesrv_handle *dcesrv_handle_lookup(struct dcesrv_call_state *call,
                                           const struct policy_handle *p,
                                           uint8_t handle_type);
index 043870f..2362a89 100644 (file)
@@ -38,9 +38,11 @@ static int dcesrv_handle_destructor(struct dcesrv_handle *h)
 /*
   allocate a new rpc handle
 */
-_PUBLIC_ struct dcesrv_handle *dcesrv_handle_new(struct dcesrv_connection_context *context, 
-                                                uint8_t handle_type)
+_PUBLIC_
+struct dcesrv_handle *dcesrv_handle_create(struct dcesrv_call_state *call,
+                                          uint8_t handle_type)
 {
+       struct dcesrv_connection_context *context = call->context;
        struct dcesrv_handle *h;
        struct dom_sid *sid;
 
@@ -73,22 +75,17 @@ _PUBLIC_ struct dcesrv_handle *dcesrv_handle_new(struct dcesrv_connection_contex
        return h;
 }
 
-_PUBLIC_
-struct dcesrv_handle *dcesrv_handle_create(struct dcesrv_call_state *call,
-                                          uint8_t handle_type)
-{
-       return dcesrv_handle_new(call->context, handle_type);
-}
-
 /**
   find an internal handle given a wire handle. If the wire handle is NULL then
   allocate a new handle
 */
-_PUBLIC_ struct dcesrv_handle *dcesrv_handle_fetch(
-                                         struct dcesrv_connection_context *context, 
-                                         const struct policy_handle *p,
-                                         uint8_t handle_type)
+
+_PUBLIC_
+struct dcesrv_handle *dcesrv_handle_lookup(struct dcesrv_call_state *call,
+                                          const struct policy_handle *p,
+                                          uint8_t handle_type)
 {
+       struct dcesrv_connection_context *context = call->context;
        struct dcesrv_handle *h;
        struct dom_sid *sid;
 
@@ -101,7 +98,7 @@ _PUBLIC_ struct dcesrv_handle *dcesrv_handle_fetch(
 
        if (ndr_policy_handle_empty(p)) {
                /* TODO: we should probably return a NULL handle here */
-               return dcesrv_handle_new(context, handle_type);
+               return dcesrv_handle_create(call, handle_type);
        }
 
        for (h=context->conn->assoc_group->handles; h; h=h->next) {
@@ -129,11 +126,3 @@ _PUBLIC_ struct dcesrv_handle *dcesrv_handle_fetch(
 
        return NULL;
 }
-
-_PUBLIC_
-struct dcesrv_handle *dcesrv_handle_lookup(struct dcesrv_call_state *call,
-                                          const struct policy_handle *p,
-                                          uint8_t handle_type)
-{
-       return dcesrv_handle_fetch(call->context, p, handle_type);
-}