From: Jeremy Allison Date: Thu, 19 Apr 2007 00:51:18 +0000 (+0000) Subject: r22354: Make client select krb5 encrpyt if krb5 already on. X-Git-Tag: samba-misc-tags/initial-v3-0-unstable~665 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7b89a5de57cd5fed814eda95e44dcc345f380fb2;p=thirdparty%2Fsamba.git r22354: Make client select krb5 encrpyt if krb5 already on. Jeremy. --- diff --git a/source/client/client.c b/source/client/client.c index a4c75f2735e..2df5c67db12 100644 --- a/source/client/client.c +++ b/source/client/client.c @@ -1789,34 +1789,39 @@ static int cmd_open(void) static int cmd_posix_encrypt(void) { - fstring buf; - fstring domain; - fstring user; - fstring password; NTSTATUS status; - if (!next_token_nr(NULL,buf,NULL,sizeof(buf))) { - d_printf("posix_encrypt domain user password\n"); - return 1; - } - fstrcpy(domain,buf); + if (cli->use_kerberos) { + status = cli_gss_smb_encryption_start(cli); + } else { + fstring buf; + fstring domain; + fstring user; + fstring password; - if (!next_token_nr(NULL,buf,NULL,sizeof(buf))) { - d_printf("posix_encrypt domain user password\n"); - return 1; - } - fstrcpy(user,buf); + if (!next_token_nr(NULL,buf,NULL,sizeof(buf))) { + d_printf("posix_encrypt domain user password\n"); + return 1; + } + fstrcpy(domain,buf); - if (!next_token_nr(NULL,buf,NULL,sizeof(buf))) { - d_printf("posix_encrypt domain user password\n"); - return 1; - } - fstrcpy(password,buf); + if (!next_token_nr(NULL,buf,NULL,sizeof(buf))) { + d_printf("posix_encrypt domain user password\n"); + return 1; + } + fstrcpy(user,buf); - status = cli_raw_ntlm_smb_encryption_start(cli, - user, - password, - domain); + if (!next_token_nr(NULL,buf,NULL,sizeof(buf))) { + d_printf("posix_encrypt domain user password\n"); + return 1; + } + fstrcpy(password,buf); + + status = cli_raw_ntlm_smb_encryption_start(cli, + user, + password, + domain); + } if (!NT_STATUS_IS_OK(status)) { d_printf("posix_encrypt failed with error %s\n", nt_errstr(status)); diff --git a/source/libsmb/clifsinfo.c b/source/libsmb/clifsinfo.c index 4924bfdba09..e46456abb18 100644 --- a/source/libsmb/clifsinfo.c +++ b/source/libsmb/clifsinfo.c @@ -614,4 +614,9 @@ NTSTATUS cli_gss_smb_encryption_start(struct cli_state *cli) common_free_encryption_state(&es); return status; } +#else +NTSTATUS cli_gss_smb_encryption_start(struct cli_state *cli) +{ + return NT_STATUS_NOT_SUPPORTED; +} #endif