summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-09-07 21:10:24 +0200
committerStefan Metzmacher <metze@samba.org>2011-09-08 08:51:48 +0200
commitcdca1e0ac3c185856fbe2d061a30bfa8e71e4e1c (patch)
tree68b6c60565674217578ed519d4ee45fd4b740da7 /source3/libsmb
parent2c741efc993186c1f814ba0aaaf89cf80f911196 (diff)
downloadsamba-cdca1e0ac3c185856fbe2d061a30bfa8e71e4e1c.tar.gz
samba-cdca1e0ac3c185856fbe2d061a30bfa8e71e4e1c.tar.bz2
samba-cdca1e0ac3c185856fbe2d061a30bfa8e71e4e1c.zip
s3:libsmb: pass CLI_FULL_CONNECTION_* flags to cli_state_create()
metze
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/cliconnect.c3
-rw-r--r--source3/libsmb/clientgen.c23
-rw-r--r--source3/libsmb/proto.h3
3 files changed, 26 insertions, 3 deletions
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c
index eaac4638a9..e3e2bc4e0b 100644
--- a/source3/libsmb/cliconnect.c
+++ b/source3/libsmb/cliconnect.c
@@ -2854,6 +2854,7 @@ NTSTATUS cli_connect_nb(const char *host, const struct sockaddr_storage *dest_ss
int fd = -1;
char *desthost;
char *p;
+ int flags = 0;
desthost = talloc_strdup(talloc_tos(), host);
if (desthost == NULL) {
@@ -2875,7 +2876,7 @@ NTSTATUS cli_connect_nb(const char *host, const struct sockaddr_storage *dest_ss
goto fail;
}
- cli = cli_state_create(NULL, fd, desthost, NULL, signing_state);
+ cli = cli_state_create(NULL, fd, desthost, NULL, signing_state, flags);
if (cli == NULL) {
goto fail;
}
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c
index 4689c7aa63..20b64b616c 100644
--- a/source3/libsmb/clientgen.c
+++ b/source3/libsmb/clientgen.c
@@ -165,7 +165,7 @@ struct cli_state *cli_state_create(TALLOC_CTX *mem_ctx,
int fd,
const char *remote_name,
const char *remote_realm,
- int signing_state)
+ int signing_state, int flags)
{
struct cli_state *cli = NULL;
bool allow_smb_signing = false;
@@ -204,6 +204,27 @@ struct cli_state *cli_state_create(TALLOC_CTX *mem_ctx,
if (getenv("CLI_FORCE_DOSERR"))
cli->force_dos_errors = true;
+ if (flags & CLI_FULL_CONNECTION_DONT_SPNEGO) {
+ cli->use_spnego = false;
+ } else if (flags & CLI_FULL_CONNECTION_USE_KERBEROS) {
+ cli->use_kerberos = true;
+ }
+ if ((flags & CLI_FULL_CONNECTION_FALLBACK_AFTER_KERBEROS) &&
+ cli->use_kerberos) {
+ cli->fallback_after_kerberos = true;
+ }
+
+ if (flags & CLI_FULL_CONNECTION_USE_CCACHE) {
+ cli->use_ccache = true;
+ }
+
+ if (flags & CLI_FULL_CONNECTION_OPLOCKS) {
+ cli->use_oplocks = true;
+ }
+ if (flags & CLI_FULL_CONNECTION_LEVEL_II_OPLOCKS) {
+ cli->use_level_II_oplocks = true;
+ }
+
if (lp_client_signing()) {
allow_smb_signing = true;
}
diff --git a/source3/libsmb/proto.h b/source3/libsmb/proto.h
index f9329241c7..8ff0a1b2d6 100644
--- a/source3/libsmb/proto.h
+++ b/source3/libsmb/proto.h
@@ -159,7 +159,8 @@ struct cli_state *cli_state_create(TALLOC_CTX *mem_ctx,
int fd,
const char *remote_name,
const char *remote_realm,
- int signing_state);
+ int signing_state,
+ int flags);
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);