diff options
author | Stefan Metzmacher <metze@samba.org> | 2011-07-18 19:46:59 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2011-07-21 22:08:51 +0200 |
commit | c70103f3f81c45846acc60fa84027247d72913f5 (patch) | |
tree | e32a88762cca255fb9ea1a5d97c7a47c0ad1344b /source3 | |
parent | fb2ee304a8c3add275f9aead63ba2654e4144699 (diff) | |
download | samba-c70103f3f81c45846acc60fa84027247d72913f5.tar.gz samba-c70103f3f81c45846acc60fa84027247d72913f5.tar.bz2 samba-c70103f3f81c45846acc60fa84027247d72913f5.zip |
s3:libsmb: add cli_state_encryption_on()
metze
Diffstat (limited to 'source3')
-rw-r--r-- | source3/libsmb/clientgen.c | 6 | ||||
-rw-r--r-- | source3/libsmb/libsmb_context.c | 2 | ||||
-rw-r--r-- | source3/libsmb/proto.h | 1 |
3 files changed, 8 insertions, 1 deletions
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c index 0ee361f862..ab0079650a 100644 --- a/source3/libsmb/clientgen.c +++ b/source3/libsmb/clientgen.c @@ -257,6 +257,12 @@ struct cli_state *cli_initialise(void) return cli_initialise_ex(Undefined); } +bool cli_state_encryption_on(struct cli_state *cli) +{ + return common_encryption_on(cli->trans_enc_state); +} + + /**************************************************************************** Close all pipes open on this session. ****************************************************************************/ diff --git a/source3/libsmb/libsmb_context.c b/source3/libsmb/libsmb_context.c index 14f646fef3..789a555400 100644 --- a/source3/libsmb/libsmb_context.c +++ b/source3/libsmb/libsmb_context.c @@ -470,7 +470,7 @@ smbc_option_get(SMBCCTX *context, for (s = context->internal->servers; s; s = s->next) { num_servers++; - if (s->cli->trans_enc_state == NULL) { + if (!cli_state_encryption_on(s->cli)) { return (void *)false; } } diff --git a/source3/libsmb/proto.h b/source3/libsmb/proto.h index 127983de84..98aabee0a7 100644 --- a/source3/libsmb/proto.h +++ b/source3/libsmb/proto.h @@ -161,6 +161,7 @@ NTSTATUS cli_set_password(struct cli_state *cli, const char *password); NTSTATUS cli_init_creds(struct cli_state *cli, const char *username, const char *domain, const char *password); struct cli_state *cli_initialise(void); struct cli_state *cli_initialise_ex(int signing_state); +bool cli_state_encryption_on(struct cli_state *cli); void cli_nt_pipes_close(struct cli_state *cli); void cli_shutdown(struct cli_state *cli); void cli_sockopt(struct cli_state *cli, const char *options); |