/****************************************************************
****************************************************************/
+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;
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;
#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, ...);