]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:net: correctly implement --use-ccache as legacy for --use-winbind-ccache for ...
authorStefan Metzmacher <metze@samba.org>
Thu, 7 Mar 2024 12:50:39 +0000 (13:50 +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.c
source3/utils/net.h

index badf2e046c24b8f9cdbd95d1e24c9c74b4dddf34..a4726c1ca17241ba618f68944ef97650c3cc29ef 100644 (file)
@@ -1047,10 +1047,11 @@ static struct functable net_func[] = {
                        .arg        = &c->opt_request_timeout,
                },
                {
+                       /* legacy for --use-winbind-ccache */
                        .longName   = "use-ccache",
                        .shortName  = 0,
                        .argInfo    = POPT_ARG_NONE,
-                       .arg        = &c->opt_ccache,
+                       .arg        = &c->legacy_opt_ccache,
                },
                {
                        .longName   = "verbose",
@@ -1388,7 +1389,12 @@ static struct functable net_func[] = {
                c->opt_kerberos = (krb5_state > CRED_USE_KERBEROS_DESIRED);
 
                gensec_features = cli_credentials_get_gensec_features(c->creds);
-               c->opt_ccache = (gensec_features & GENSEC_FEATURE_NTLM_CCACHE);
+               if (c->legacy_opt_ccache) {
+                       gensec_features |= GENSEC_FEATURE_NTLM_CCACHE;
+                       cli_credentials_set_gensec_features(c->creds,
+                                                           gensec_features,
+                                                           CRED_SPECIFIED);
+               }
        }
 
        c->msg_ctx = cmdline_messaging_context(get_dyn_CONFIGFILE());
index fca3a9953af2cae7e6ecac03cf3aa7682bc5cb1b..559e97930a65ae62cf37b20f9eb4310d25bd1b8c 100644 (file)
@@ -73,7 +73,7 @@ struct net_context {
        int opt_testmode;
        int opt_kerberos;
        int opt_force_full_repl;
-       int opt_ccache;
+       int legacy_opt_ccache;
        int opt_single_obj_repl;
        int opt_clean_old_entries;
        const char *opt_db;