From: Andreas Schneider Date: Mon, 3 Apr 2023 06:14:30 +0000 (+0200) Subject: s3:utils: s3:utils: Correctly wire winbind ccache support for smbget X-Git-Tag: talloc-2.4.1~1101 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=960fe1ca27357d8c2f85f956531dfbe6bbc025f7;p=thirdparty%2Fsamba.git s3:utils: s3:utils: Correctly wire winbind ccache support for smbget Signed-off-by: Andreas Schneider Reviewed-by: Andrew Bartlett --- diff --git a/source3/utils/smbget.c b/source3/utils/smbget.c index e8d6936a24c..20580fd3572 100644 --- a/source3/utils/smbget.c +++ b/source3/utils/smbget.c @@ -22,6 +22,7 @@ #include "libsmbclient.h" #include "cmdline_contexts.h" #include "auth/credentials/credentials.h" +#include "auth/gensec/gensec.h" static int columns = 0; @@ -864,6 +865,8 @@ int main(int argc, char **argv) enum credentials_use_kerberos use_kerberos = CRED_USE_KERBEROS_DESIRED; smbc_smb_encrypt_level encrypt_level = SMBC_ENCRYPTLEVEL_DEFAULT; bool is_nt_hash = false; + uint32_t gensec_features; + bool use_wbccache = false; SMBCCTX *smb_ctx = NULL; smb_init_locale(); @@ -988,6 +991,11 @@ int main(int argc, char **argv) is_nt_hash = cli_credentials_is_password_nt_hash(creds); smbc_setOptionUseNTHash(smb_ctx, is_nt_hash); + /* Check if we should use the winbind ccache */ + gensec_features = cli_credentials_get_gensec_features(creds); + use_wbccache = (gensec_features & GENSEC_FEATURE_NTLM_CCACHE); + smbc_setOptionUseCCache(smb_ctx, use_wbccache); + columns = get_num_cols(); total_start_time = time_mono(NULL);