]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:utils: Correctly wire NT hash support for smbget
authorAndreas Schneider <asn@samba.org>
Fri, 31 Mar 2023 07:49:44 +0000 (09:49 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 5 Apr 2023 01:06:29 +0000 (01:06 +0000)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/utils/smbget.c

index b19a202fd8193ead578c432370584fd563213f10..e8d6936a24c960a127985bae326d05f9f592bbee 100644 (file)
@@ -863,6 +863,7 @@ int main(int argc, char **argv)
        enum smb_encryption_setting encryption_state = SMB_ENCRYPTION_DEFAULT;
        enum credentials_use_kerberos use_kerberos = CRED_USE_KERBEROS_DESIRED;
        smbc_smb_encrypt_level encrypt_level = SMBC_ENCRYPTLEVEL_DEFAULT;
+       bool is_nt_hash = false;
        SMBCCTX *smb_ctx = NULL;
 
        smb_init_locale();
@@ -983,6 +984,10 @@ int main(int argc, char **argv)
                break;
        }
 
+       /* Check if the password supplied is an NT hash */
+       is_nt_hash = cli_credentials_is_password_nt_hash(creds);
+       smbc_setOptionUseNTHash(smb_ctx, is_nt_hash);
+
        columns = get_num_cols();
 
        total_start_time = time_mono(NULL);