diff options
author | Günther Deschner <gd@samba.org> | 2008-07-17 19:56:25 +0200 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2008-07-18 16:52:05 +0200 |
commit | 4704864338b62a57afb86986ed2d4a0ce0a97020 (patch) | |
tree | cd9a7b655784fb4b0b0de1dd59cadb32c0c2da1f /source3/lib/netapi | |
parent | 3b667f90aaefe3c5d064b18542ae3c5b3d4771cd (diff) | |
download | samba-4704864338b62a57afb86986ed2d4a0ce0a97020.tar.gz samba-4704864338b62a57afb86986ed2d4a0ce0a97020.tar.bz2 samba-4704864338b62a57afb86986ed2d4a0ce0a97020.zip |
netapi: add libnetapi_samr_close_builtin_handle().
Guenther
(This used to be commit 05cad0d8b4205c052c607b1d36c121bb4c226ab1)
Diffstat (limited to 'source3/lib/netapi')
-rw-r--r-- | source3/lib/netapi/netapi_private.h | 2 | ||||
-rw-r--r-- | source3/lib/netapi/samr.c | 24 |
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) { |