diff options
author | Jeremy Allison <jra@samba.org> | 2007-04-19 00:51:18 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:19:28 -0500 |
commit | f7fc540d848d5f5950f4adf921b5972be2eb81a4 (patch) | |
tree | 2da58daca0562304e877387e826f2477fccb9c71 /source3 | |
parent | 383cc1fa1c472bacd2dc77b05e8c90dc82f3bbde (diff) | |
download | samba-f7fc540d848d5f5950f4adf921b5972be2eb81a4.tar.gz samba-f7fc540d848d5f5950f4adf921b5972be2eb81a4.tar.bz2 samba-f7fc540d848d5f5950f4adf921b5972be2eb81a4.zip |
r22354: Make client select krb5 encrpyt if krb5 already on.
Jeremy.
(This used to be commit 7b89a5de57cd5fed814eda95e44dcc345f380fb2)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/client/client.c | 51 | ||||
-rw-r--r-- | source3/libsmb/clifsinfo.c | 5 |
2 files changed, 33 insertions, 23 deletions
diff --git a/source3/client/client.c b/source3/client/client.c index a4c75f2735..2df5c67db1 100644 --- a/source3/client/client.c +++ b/source3/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/source3/libsmb/clifsinfo.c b/source3/libsmb/clifsinfo.c index 4924bfdba0..e46456abb1 100644 --- a/source3/libsmb/clifsinfo.c +++ b/source3/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 |