s3:libsmb: add CLI_FULL_CONNECTION_FORCE_ASCII
authorStefan Metzmacher <metze@samba.org>
Thu, 8 Sep 2011 07:49:26 +0000 (09:49 +0200)
committerStefan Metzmacher <metze@samba.org>
Thu, 8 Sep 2011 15:51:30 +0000 (17:51 +0200)
metze

source3/include/client.h
source3/libsmb/cliconnect.c
source3/libsmb/clientgen.c

index 6566769eac972be1ab2311f757eb00befdde8da5..9eae22214042f28c688e3148c6ec61280ba55cbc 100644 (file)
@@ -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 */
index 2ae7cbbcdeb5581b3d6c44e5cbc803dfe55def51..fd0536cb6fb9f035cb4a0aed45243226210e5600 100644 (file)
@@ -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);
 }
index ad4274a282520992db3d8bed28bd4ad6ef5652c6..f274dc0b63fad6d36212583e152ab83164c3ee41 100644 (file)
@@ -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;