From: Stefan Metzmacher Date: Thu, 7 Mar 2024 11:08:00 +0000 (+0100) Subject: s3:net_ads: remove unused use_in_memory_ccache() X-Git-Tag: tdb-1.4.11~730 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eb9ad5cc8902678b399a777138f3b92c4d949874;p=thirdparty%2Fsamba.git s3:net_ads: remove unused use_in_memory_ccache() Signed-off-by: Stefan Metzmacher Reviewed-by: Andreas Schneider --- diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c index 90c9c0de3aa..19a6e06b6e9 100644 --- a/source3/utils/net_ads.c +++ b/source3/utils/net_ads.c @@ -1474,10 +1474,6 @@ static int net_ads_leave(struct net_context *c, int argc, const char **argv) 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")); @@ -1580,7 +1576,6 @@ out: 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" @@ -1700,10 +1695,6 @@ int net_ads_join(struct net_context *c, int argc, const char **argv) } } - if (!c->opt_kerberos) { - use_in_memory_ccache(); - } - werr = libnet_init_JoinCtx(tmp_ctx, &r); if (!W_ERROR_IS_OK(werr)) { goto fail; @@ -2575,7 +2566,6 @@ static int net_ads_password(struct net_context *c, int argc, const char **argv) goto out; } - use_in_memory_ccache(); chr = strchr_m(auth_principal, '@'); if (chr) { realm = ++chr; @@ -2675,8 +2665,6 @@ int net_ads_changetrustpw(struct net_context *c, int argc, const char **argv) 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; diff --git a/source3/utils/net_ads_join_dns.c b/source3/utils/net_ads_join_dns.c index 617a0d94246..ac8ffc64998 100644 --- a/source3/utils/net_ads_join_dns.c +++ b/source3/utils/net_ads_join_dns.c @@ -24,7 +24,6 @@ #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" @@ -37,12 +36,6 @@ #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, diff --git a/source3/utils/net_proto.h b/source3/utils/net_proto.h index 1678affd30c..baca8575585 100644 --- a/source3/utils/net_proto.h +++ b/source3/utils/net_proto.h @@ -55,7 +55,6 @@ int net_ads_setspn(struct net_context *c, int argc, const char **argv); 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,