diff options
author | Stefan Metzmacher <metze@samba.org> | 2011-09-08 09:49:26 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2011-09-08 17:51:30 +0200 |
commit | a7e418dd45fe81af4ec4fbddfcfffb491487a8b7 (patch) | |
tree | 1d229cf3991ece03c6a086b9abbef1df835f6968 | |
parent | db79aa7260759c451e38e2df46562d01ce5514c6 (diff) | |
download | samba-a7e418dd45fe81af4ec4fbddfcfffb491487a8b7.tar.gz samba-a7e418dd45fe81af4ec4fbddfcfffb491487a8b7.tar.bz2 samba-a7e418dd45fe81af4ec4fbddfcfffb491487a8b7.zip |
s3:libsmb: add CLI_FULL_CONNECTION_FORCE_ASCII
metze
-rw-r--r-- | source3/include/client.h | 2 | ||||
-rw-r--r-- | source3/libsmb/cliconnect.c | 3 | ||||
-rw-r--r-- | source3/libsmb/clientgen.c | 8 |
3 files changed, 12 insertions, 1 deletions
diff --git a/source3/include/client.h b/source3/include/client.h index 6566769eac..9eae222140 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -114,6 +114,7 @@ struct cli_state { bool use_level_II_oplocks; /* should we use level II oplocks? */ bool force_dos_errors; + bool force_ascii; bool case_sensitive; /* False by default. */ /* Where (if anywhere) this is mounted under DFS. */ @@ -194,5 +195,6 @@ struct file_info { #define CLI_FULL_CONNECTION_LEVEL_II_OPLOCKS 0x0020 #define CLI_FULL_CONNECTION_USE_CCACHE 0x0040 #define CLI_FULL_CONNECTION_FORCE_DOS_ERRORS 0x0080 +#define CLI_FULL_CONNECTION_FORCE_ASCII 0x0100 #endif /* _CLIENT_H */ diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c index 2ae7cbbcde..fd0536cb6f 100644 --- a/source3/libsmb/cliconnect.c +++ b/source3/libsmb/cliconnect.c @@ -2723,8 +2723,9 @@ static void cli_negprot_done(struct tevent_req *subreq) cli->max_xmit = MIN(cli->max_xmit, CLI_BUFFER_SIZE); /* a way to force ascii SMB */ - if (getenv("CLI_FORCE_ASCII")) + if (cli->force_ascii) { cli->capabilities &= ~CAP_UNICODE; + } tevent_req_done(req); } diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c index ad4274a282..f274dc0b63 100644 --- a/source3/libsmb/clientgen.c +++ b/source3/libsmb/clientgen.c @@ -206,6 +206,14 @@ struct cli_state *cli_state_create(TALLOC_CTX *mem_ctx, } if (flags & CLI_FULL_CONNECTION_FORCE_DOS_ERRORS) { cli->force_dos_errors = true; + } + + if (getenv("CLI_FORCE_ASCII")) { + cli->force_ascii = true; + } + if (flags & CLI_FULL_CONNECTION_FORCE_ASCII) { + cli->force_ascii = true; + } if (flags & CLI_FULL_CONNECTION_DONT_SPNEGO) { cli->use_spnego = false; |