summaryrefslogtreecommitdiff
path: root/source3/lib/netapi
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/netapi')
-rw-r--r--source3/lib/netapi/netapi.c28
-rw-r--r--source3/lib/netapi/netapi.h2
-rw-r--r--source3/lib/netapi/netapi_private.h18
3 files changed, 48 insertions, 0 deletions
diff --git a/source3/lib/netapi/netapi.c b/source3/lib/netapi/netapi.c
index cf1be00849..2cc636ffb7 100644
--- a/source3/lib/netapi/netapi.c
+++ b/source3/lib/netapi/netapi.c
@@ -30,8 +30,30 @@ static bool libnetapi_initialized = false;
/****************************************************************
****************************************************************/
+static NET_API_STATUS libnetapi_init_private_context(struct libnetapi_ctx *ctx)
+{
+ struct libnetapi_private_ctx *priv;
+
+ if (!ctx) {
+ return W_ERROR_V(WERR_INVALID_PARAM);
+ }
+
+ priv = TALLOC_ZERO_P(ctx, struct libnetapi_private_ctx);
+ if (!priv) {
+ return W_ERROR_V(WERR_NOMEM);
+ }
+
+ ctx->private_data = priv;
+
+ return NET_API_STATUS_SUCCESS;
+}
+
+/****************************************************************
+****************************************************************/
+
NET_API_STATUS libnetapi_init(struct libnetapi_ctx **context)
{
+ NET_API_STATUS status;
struct libnetapi_ctx *ctx = NULL;
char *krb5_cc_env = NULL;
@@ -96,6 +118,12 @@ NET_API_STATUS libnetapi_init(struct libnetapi_ctx **context)
return W_ERROR_V(WERR_NOMEM);
}
+ status = libnetapi_init_private_context(ctx);
+ if (status != 0) {
+ TALLOC_FREE(frame);
+ return status;
+ }
+
libnetapi_initialized = true;
*context = stat_ctx = ctx;
diff --git a/source3/lib/netapi/netapi.h b/source3/lib/netapi/netapi.h
index f6345afe67..3612fa8240 100644
--- a/source3/lib/netapi/netapi.h
+++ b/source3/lib/netapi/netapi.h
@@ -191,6 +191,8 @@ struct libnetapi_ctx {
char *password;
char *krb5_cc_env;
int use_kerberos;
+
+ void *private_data;
};
/****************************************************************
diff --git a/source3/lib/netapi/netapi_private.h b/source3/lib/netapi/netapi_private.h
index 3ce078c2b6..c913fe789d 100644
--- a/source3/lib/netapi/netapi_private.h
+++ b/source3/lib/netapi/netapi_private.h
@@ -20,6 +20,24 @@
#ifndef __LIB_NETAPI_PRIVATE_H__
#define __LIB_NETAPI_PRIVATE_H__
+struct libnetapi_private_ctx {
+ struct {
+ const char *domain_name;
+ struct dom_sid *domain_sid;
+ struct rpc_pipe_client *cli;
+
+ uint32_t connect_mask;
+ struct policy_handle connect_handle;
+
+ uint32_t domain_mask;
+ struct policy_handle domain_handle;
+
+ uint32_t builtin_mask;
+ struct policy_handle builtin_handle;
+ } samr;
+
+};
+
NET_API_STATUS libnetapi_get_password(struct libnetapi_ctx *ctx, char **password);
NET_API_STATUS libnetapi_get_username(struct libnetapi_ctx *ctx, char **username);
NET_API_STATUS libnetapi_set_error_string(struct libnetapi_ctx *ctx, const char *format, ...);