]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
lib:cmdline: Check if we have a valid default ccache
authorAndreas Schneider <asn@samba.org>
Fri, 25 Apr 2025 15:32:16 +0000 (17:32 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Tue, 5 Aug 2025 10:49:34 +0000 (10:49 +0000)
If you don't specify anything, and we have a valid ccache then try to
use it!

> smbclient -L //samba1.earth.milkyway.site
Anonymous login successful

        Sharename       Type      Comment
        ---------       ----      -------
        print$          Disk      Printer Drivers
        IPC$            IPC       IPC Service (Samba 4.22.1)
SMB1 disabled -- no workgroup available

In case the user specifies a principal, it will ask for a password:

> bin/smbclient -L //samba1.earth.milkyway.site -Ualice1@EARTH.MILKYWAY.SITE
Password for [alice1@EARTH.MILKYWAY.SITE]:

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
lib/cmdline/cmdline.c

index e434d65a2ef019df472f94c94492b140c403b40e..f96ca88f95b22850cbdfb27e6367299b765cef50 100644 (file)
@@ -1031,8 +1031,8 @@ static void popt_common_credentials_callback(poptContext popt_ctx,
                        }
                }
 
-               if (cli_credentials_get_kerberos_state(creds) ==
-                   CRED_USE_KERBEROS_REQUIRED)
+               if (cli_credentials_get_kerberos_state(creds) !=
+                   CRED_USE_KERBEROS_DISABLED)
                {
                        enum credentials_obtained ccache_obtained =
                                CRED_UNINITIALISED;