1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

r22354: Make client select krb5 encrpyt if krb5 already on.

Jeremy.
This commit is contained in:
Jeremy Allison 2007-04-19 00:51:18 +00:00 committed by Gerald (Jerry) Carter
parent 9173c846b1
commit 7b89a5de57
2 changed files with 33 additions and 23 deletions

View File

@ -1789,34 +1789,39 @@ static int cmd_open(void)
static int cmd_posix_encrypt(void) static int cmd_posix_encrypt(void)
{ {
fstring buf;
fstring domain;
fstring user;
fstring password;
NTSTATUS status; NTSTATUS status;
if (!next_token_nr(NULL,buf,NULL,sizeof(buf))) { if (cli->use_kerberos) {
d_printf("posix_encrypt domain user password\n"); status = cli_gss_smb_encryption_start(cli);
return 1; } else {
} fstring buf;
fstrcpy(domain,buf); fstring domain;
fstring user;
fstring password;
if (!next_token_nr(NULL,buf,NULL,sizeof(buf))) { if (!next_token_nr(NULL,buf,NULL,sizeof(buf))) {
d_printf("posix_encrypt domain user password\n"); d_printf("posix_encrypt domain user password\n");
return 1; return 1;
} }
fstrcpy(user,buf); fstrcpy(domain,buf);
if (!next_token_nr(NULL,buf,NULL,sizeof(buf))) { if (!next_token_nr(NULL,buf,NULL,sizeof(buf))) {
d_printf("posix_encrypt domain user password\n"); d_printf("posix_encrypt domain user password\n");
return 1; return 1;
} }
fstrcpy(password,buf); fstrcpy(user,buf);
status = cli_raw_ntlm_smb_encryption_start(cli, if (!next_token_nr(NULL,buf,NULL,sizeof(buf))) {
user, d_printf("posix_encrypt domain user password\n");
password, return 1;
domain); }
fstrcpy(password,buf);
status = cli_raw_ntlm_smb_encryption_start(cli,
user,
password,
domain);
}
if (!NT_STATUS_IS_OK(status)) { if (!NT_STATUS_IS_OK(status)) {
d_printf("posix_encrypt failed with error %s\n", nt_errstr(status)); d_printf("posix_encrypt failed with error %s\n", nt_errstr(status));

View File

@ -614,4 +614,9 @@ NTSTATUS cli_gss_smb_encryption_start(struct cli_state *cli)
common_free_encryption_state(&es); common_free_encryption_state(&es);
return status; return status;
} }
#else
NTSTATUS cli_gss_smb_encryption_start(struct cli_state *cli)
{
return NT_STATUS_NOT_SUPPORTED;
}
#endif #endif