return -1;
}
- if (!c->opt_kerberos) {
- use_in_memory_ccache();
- }
-
if (!c->msg_ctx) {
d_fprintf(stderr, _("Could not initialise message context. "
"Try running as root\n"));
int net_ads_testjoin(struct net_context *c, int argc, const char **argv)
{
ADS_STATUS status;
- use_in_memory_ccache();
if (c->display_usage) {
d_printf( "%s\n"
}
}
- if (!c->opt_kerberos) {
- use_in_memory_ccache();
- }
-
werr = libnet_init_JoinCtx(tmp_ctx, &r);
if (!W_ERROR_IS_OK(werr)) {
goto fail;
goto out;
}
- use_in_memory_ccache();
chr = strchr_m(auth_principal, '@');
if (chr) {
realm = ++chr;
net_use_krb_machine_account(c);
- use_in_memory_ccache();
-
status = ads_startup(c, true, tmp_ctx, &ads);
if (!ADS_ERR_OK(status)) {
goto out;
#include "utils/net.h"
#include "../lib/addns/dnsquery.h"
#include "passdb.h"
-#include "krb5_env.h"
#include "utils/net_dns.h"
#include "lib/util/string_wrappers.h"
#if defined(HAVE_KRB5)
#include "../lib/addns/dns.h"
-void use_in_memory_ccache(void) {
- /* Use in-memory credentials cache so we do not interfere with
- * existing credentials */
- setenv(KRB5_ENV_CCNAME, "MEMORY:net_ads", 1);
-}
-
static NTSTATUS net_update_dns_internal(struct net_context *c,
TALLOC_CTX *ctx,
ADS_STRUCT *ads,
int net_ads(struct net_context *c, int argc, const char **argv);
/* The following definitions come from utils/net_ads_join_dns.c */
-void use_in_memory_ccache(void);
NTSTATUS net_update_dns_ext(struct net_context *c,
TALLOC_CTX *mem_ctx,
ADS_STRUCT *ads,