]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:net_ads: remove unused use_in_memory_ccache()
authorStefan Metzmacher <metze@samba.org>
Thu, 7 Mar 2024 11:08:00 +0000 (12:08 +0100)
committerStefan Metzmacher <metze@samba.org>
Tue, 14 May 2024 10:18:31 +0000 (10:18 +0000)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/utils/net_ads.c
source3/utils/net_ads_join_dns.c
source3/utils/net_proto.h

index 90c9c0de3aa640a467fb546bfa517a359a05c358..19a6e06b6e9df01d335f6e5e0cd15d9920a9f6e0 100644 (file)
@@ -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;
index 617a0d94246219d12261f989103095abc025940a..ac8ffc649986bc44badf9a7ab26cd10fda544207 100644 (file)
@@ -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"
 
 #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,
index 1678affd30caddfbe1e4bab59effb5ddd0a6f43f..baca8575585969cefb721bf05cf0fe3a580baa7f 100644 (file)
@@ -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,