diff options
author | Stefan Metzmacher <metze@samba.org> | 2011-09-08 16:09:35 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2011-09-15 08:33:12 +0200 |
commit | 91cba0235f7f20f8a9dec9dffaca7e5329107ad6 (patch) | |
tree | ca08a2ba4f7d0ebd25bbde9bc0b4057ec20117f4 | |
parent | 3162d86528d152d8a055294e6e4d6f326828c772 (diff) | |
download | samba-91cba0235f7f20f8a9dec9dffaca7e5329107ad6.tar.gz samba-91cba0235f7f20f8a9dec9dffaca7e5329107ad6.tar.bz2 samba-91cba0235f7f20f8a9dec9dffaca7e5329107ad6.zip |
s3:libsmb: calculate all SMB1 capabilities we want to support for the connection
We should do this at startup in cli_state_create()
and later calculate the negotiated capabilities in
cli_negprot_done().
metze
-rw-r--r-- | source3/libsmb/clientgen.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c index c22cd303e5..be7f462471 100644 --- a/source3/libsmb/clientgen.c +++ b/source3/libsmb/clientgen.c @@ -197,8 +197,6 @@ struct cli_state *cli_state_create(TALLOC_CTX *mem_ctx, cli->use_spnego = lp_client_use_spnego(); - cli->capabilities = CAP_UNICODE | CAP_STATUS32 | CAP_DFS; - /* Set the CLI_FORCE_DOSERR environment variable to test client routines using DOS errors instead of STATUS32 ones. This intended only as a temporary hack. */ @@ -279,6 +277,30 @@ struct cli_state *cli_state_create(TALLOC_CTX *mem_ctx, goto error; } + cli->capabilities = 0; + cli->capabilities |= CAP_LARGE_FILES; + cli->capabilities |= CAP_NT_SMBS | CAP_RPC_REMOTE_APIS; + cli->capabilities |= CAP_LOCK_AND_READ | CAP_NT_FIND; + cli->capabilities |= CAP_DFS | CAP_W2K_SMBS; + cli->capabilities |= CAP_LARGE_READX|CAP_LARGE_WRITEX; + cli->capabilities |= CAP_LWIO; + + if (!cli->force_dos_errors) { + cli->capabilities |= CAP_STATUS32; + } + + if (!cli->force_ascii) { + cli->capabilities |= CAP_UNICODE; + } + + if (cli->use_spnego) { + cli->capabilities |= CAP_EXTENDED_SECURITY; + } + + if (cli->use_level_II_oplocks) { + cli->capabilities |= CAP_LEVEL_II_OPLOCKS; + } + cli->conn.outgoing = tevent_queue_create(cli, "cli_outgoing"); if (cli->conn.outgoing == NULL) { goto error; |