mirror of
https://github.com/samba-team/samba.git
synced 2025-01-26 10:04:02 +03:00
s3: rpc_server: Remove SAMR specific policy_handle_create() function
Now that we pass the handle type to the generic handle creation and find functions we can drop the specific SAMR ones. The policy_handle_create() function labeled the talloc chunk used to allocate the handle's associated data, and the policy_handle_find() is checking the name matches with the expected data. The check is performed now by the generic functions based on the handle type so we can drop these SAMR specific functions. Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
parent
da9749acb3
commit
2bde40762a
@ -464,43 +464,6 @@ bool pipe_access_check(struct pipes_struct *p)
|
||||
return True;
|
||||
}
|
||||
|
||||
void *_policy_handle_create(struct pipes_struct *p,
|
||||
struct policy_handle *hnd,
|
||||
uint8_t handle_type,
|
||||
size_t data_size,
|
||||
const char *type,
|
||||
NTSTATUS *pstatus)
|
||||
{
|
||||
struct dcesrv_handle_old *rpc_hnd = NULL;
|
||||
void *data;
|
||||
|
||||
if (p->pipe_handles->count > MAX_OPEN_POLS) {
|
||||
DEBUG(0, ("ERROR: Too many handles (%d) for RPC connection %s\n",
|
||||
(int) p->pipe_handles->count,
|
||||
ndr_interface_name(&p->contexts->syntax.uuid,
|
||||
p->contexts->syntax.if_version)));
|
||||
|
||||
*pstatus = NT_STATUS_INSUFFICIENT_RESOURCES;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
data = talloc_size(talloc_tos(), data_size);
|
||||
if (data == NULL) {
|
||||
*pstatus = NT_STATUS_NO_MEMORY;
|
||||
return NULL;
|
||||
}
|
||||
talloc_set_name_const(data, type);
|
||||
|
||||
rpc_hnd = create_rpc_handle_internal(p, hnd, handle_type, data);
|
||||
if (rpc_hnd == NULL) {
|
||||
TALLOC_FREE(data);
|
||||
*pstatus = NT_STATUS_NO_MEMORY;
|
||||
return NULL;
|
||||
}
|
||||
*pstatus = NT_STATUS_OK;
|
||||
return data;
|
||||
}
|
||||
|
||||
void *_policy_handle_find(struct pipes_struct *p,
|
||||
const struct policy_handle *hnd,
|
||||
uint8_t handle_type,
|
||||
|
@ -133,16 +133,6 @@ bool close_policy_hnd(struct pipes_struct *p, struct policy_handle *hnd);
|
||||
void close_policy_by_pipe(struct pipes_struct *p);
|
||||
bool pipe_access_check(struct pipes_struct *p);
|
||||
|
||||
void *_policy_handle_create(struct pipes_struct *p,
|
||||
struct policy_handle *hnd,
|
||||
uint8_t handle_type,
|
||||
size_t data_size,
|
||||
const char *type,
|
||||
NTSTATUS *pstatus);
|
||||
#define policy_handle_create(_p, _hnd, _hnd_type, _type, _pstatus) \
|
||||
(_type *)_policy_handle_create((_p), (_hnd), (_hnd_type), sizeof(_type), #_type, \
|
||||
(_pstatus))
|
||||
|
||||
void *_policy_handle_find(struct pipes_struct *p,
|
||||
const struct policy_handle *hnd,
|
||||
uint8_t handle_type,
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user