diff options
Diffstat (limited to 'source3/lib/netapi/samr.c')
-rw-r--r-- | source3/lib/netapi/samr.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/source3/lib/netapi/samr.c b/source3/lib/netapi/samr.c index 2346f7f956..5df50fe85b 100644 --- a/source3/lib/netapi/samr.c +++ b/source3/lib/netapi/samr.c @@ -143,3 +143,51 @@ WERROR libnetapi_samr_open_builtin_domain(TALLOC_CTX *mem_ctx, done: return werr; } + +/**************************************************************** +****************************************************************/ + +void libnetapi_samr_close_domain_handle(struct libnetapi_ctx *ctx, + struct policy_handle *handle) +{ + struct libnetapi_private_ctx *priv; + + if (!is_valid_policy_hnd(handle)) { + return; + } + + priv = talloc_get_type_abort(ctx->private_data, + struct libnetapi_private_ctx); + + if (!policy_hnd_equal(handle, &priv->samr.domain_handle)) { + return; + } + + rpccli_samr_Close(priv->samr.cli, ctx, handle); + + ZERO_STRUCT(priv->samr.domain_handle); +} + +/**************************************************************** +****************************************************************/ + +void libnetapi_samr_close_connect_handle(struct libnetapi_ctx *ctx, + struct policy_handle *handle) +{ + struct libnetapi_private_ctx *priv; + + if (!is_valid_policy_hnd(handle)) { + return; + } + + priv = talloc_get_type_abort(ctx->private_data, + struct libnetapi_private_ctx); + + if (!policy_hnd_equal(handle, &priv->samr.connect_handle)) { + return; + } + + rpccli_samr_Close(priv->samr.cli, ctx, handle); + + ZERO_STRUCT(priv->samr.connect_handle); +} |