summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/netapi/netapi_private.h2
-rw-r--r--source3/lib/netapi/samr.c24
2 files changed, 26 insertions, 0 deletions
diff --git a/source3/lib/netapi/netapi_private.h b/source3/lib/netapi/netapi_private.h
index cb08ed0394..db4eb6f0a3 100644
--- a/source3/lib/netapi/netapi_private.h
+++ b/source3/lib/netapi/netapi_private.h
@@ -66,6 +66,8 @@ WERROR libnetapi_samr_open_builtin_domain(TALLOC_CTX *mem_ctx,
struct policy_handle *builtin_handle);
void libnetapi_samr_close_domain_handle(struct libnetapi_ctx *ctx,
struct policy_handle *handle);
+void libnetapi_samr_close_builtin_handle(struct libnetapi_ctx *ctx,
+ struct policy_handle *handle);
void libnetapi_samr_close_connect_handle(struct libnetapi_ctx *ctx,
struct policy_handle *handle);
diff --git a/source3/lib/netapi/samr.c b/source3/lib/netapi/samr.c
index 5df50fe85b..bd90067a6d 100644
--- a/source3/lib/netapi/samr.c
+++ b/source3/lib/netapi/samr.c
@@ -171,6 +171,30 @@ void libnetapi_samr_close_domain_handle(struct libnetapi_ctx *ctx,
/****************************************************************
****************************************************************/
+void libnetapi_samr_close_builtin_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.builtin_handle)) {
+ return;
+ }
+
+ rpccli_samr_Close(priv->samr.cli, ctx, handle);
+
+ ZERO_STRUCT(priv->samr.builtin_handle);
+}
+
+/****************************************************************
+****************************************************************/
+
void libnetapi_samr_close_connect_handle(struct libnetapi_ctx *ctx,
struct policy_handle *handle)
{