summaryrefslogtreecommitdiff
path: root/source3/lib/netapi
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-07-17 19:47:59 +0200
committerGünther Deschner <gd@samba.org>2008-07-18 16:51:57 +0200
commit3b667f90aaefe3c5d064b18542ae3c5b3d4771cd (patch)
treec628f2e683c546a47b68775015871c0458233ddd /source3/lib/netapi
parent3f0da66d5cae7efb600080c054ab52ed5b5a650f (diff)
downloadsamba-3b667f90aaefe3c5d064b18542ae3c5b3d4771cd.tar.gz
samba-3b667f90aaefe3c5d064b18542ae3c5b3d4771cd.tar.bz2
samba-3b667f90aaefe3c5d064b18542ae3c5b3d4771cd.zip
netapi: add libnetapi_samr_close_domain/connect_handle.
Guenther (This used to be commit b042787ec61bb5cb98f882ac7be8df1691a78921)
Diffstat (limited to 'source3/lib/netapi')
-rw-r--r--source3/lib/netapi/netapi_private.h4
-rw-r--r--source3/lib/netapi/samr.c48
2 files changed, 52 insertions, 0 deletions
diff --git a/source3/lib/netapi/netapi_private.h b/source3/lib/netapi/netapi_private.h
index c913fe789d..cb08ed0394 100644
--- a/source3/lib/netapi/netapi_private.h
+++ b/source3/lib/netapi/netapi_private.h
@@ -64,5 +64,9 @@ WERROR libnetapi_samr_open_builtin_domain(TALLOC_CTX *mem_ctx,
uint32_t builtin_mask,
struct policy_handle *connect_handle,
struct policy_handle *builtin_handle);
+void libnetapi_samr_close_domain_handle(struct libnetapi_ctx *ctx,
+ struct policy_handle *handle);
+void libnetapi_samr_close_connect_handle(struct libnetapi_ctx *ctx,
+ struct policy_handle *handle);
#endif
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);
+}