{
NET_API_STATUS status;
struct libnetapi_ctx *ctx = NULL;
- char *krb5_cc_env = NULL;
-
TALLOC_CTX *frame = talloc_stackframe();
ctx = talloc_zero(frame, struct libnetapi_ctx);
BlockSignals(True, SIGPIPE);
- krb5_cc_env = getenv(KRB5_ENV_CCNAME);
- if (!krb5_cc_env || (strlen(krb5_cc_env) == 0)) {
- ctx->krb5_cc_env = talloc_strdup(ctx, "MEMORY:libnetapi");
- setenv(KRB5_ENV_CCNAME, ctx->krb5_cc_env, 1);
- }
-
if (getenv("USER")) {
ctx->username = talloc_strdup(ctx, getenv("USER"));
} else {
return NET_API_STATUS_SUCCESS;
}
+/****************************************************************
+****************************************************************/
+
NET_API_STATUS libnetapi_set_use_ccache(struct libnetapi_ctx *ctx)
{
ctx->use_ccache = true;
return NET_API_STATUS_SUCCESS;
}
+/****************************************************************
+****************************************************************/
+
+NET_API_STATUS libnetapi_set_use_memory_krb5_ccache(struct libnetapi_ctx *ctx)
+{
+ ctx->krb5_cc_env = talloc_strdup(ctx, "MEMORY:libnetapi");
+ if (!ctx->krb5_cc_env) {
+ return W_ERROR_V(WERR_NOMEM);
+ }
+ setenv(KRB5_ENV_CCNAME, ctx->krb5_cc_env, 1);
+ ctx->use_memory_krb5_ccache = 1;
+ return NET_API_STATUS_SUCCESS;
+}
+
/****************************************************************
Return a libnetapi error as a string, caller must free with NetApiBufferFree
****************************************************************/
char *krb5_cc_env;
int use_kerberos;
int use_ccache;
+ int use_memory_krb5_ccache;
int disable_policy_handle_cache;
void *private_data;
NET_API_STATUS libnetapi_set_use_ccache(struct libnetapi_ctx *ctx);
+/****************************************************************
+****************************************************************/
+
+NET_API_STATUS libnetapi_set_use_memory_krb5_ccache(struct libnetapi_ctx *ctx);
+
/****************************************************************
Return a specific libnetapi error as a string, caller must free with NetApiBufferFree
****************************************************************/