The branch, master has been updated
       via  fe11e9b s3:torture: make use of CLI_FULL_CONNECTION_DONT_SPNEGO
       via  173e323 s3:torture: make use of CLI_FULL_CONNECTION_FORCE_DOS_ERRORS
       via  a7e418d s3:libsmb: add CLI_FULL_CONNECTION_FORCE_ASCII
       via  db79aa7 s3:libsmb: add CLI_FULL_CONNECTION_FORCE_DOS_ERRORS
       via  189266d s3:libsmb: don't handle CLI_FULL_CONNECTION_* flags in 
cli_full_connection()
       via  39ffa0b s3:libsmb: don't handle CLI_FULL_CONNECTION_* flags in 
cli_start_connection()
      from  08e0627 s4-param void function cannot return value

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit fe11e9b2c6cd244dbd219de12fe83634ccd82705
Author: Stefan Metzmacher <[email protected]>
Date:   Thu Sep 8 09:56:16 2011 +0200

    s3:torture: make use of CLI_FULL_CONNECTION_DONT_SPNEGO
    
    metze
    
    Autobuild-User: Stefan Metzmacher <[email protected]>
    Autobuild-Date: Thu Sep  8 19:23:32 CEST 2011 on sn-devel-104

commit 173e323cd9623d1da8db921a3b64f23c21314c54
Author: Stefan Metzmacher <[email protected]>
Date:   Thu Sep 8 09:24:11 2011 +0200

    s3:torture: make use of CLI_FULL_CONNECTION_FORCE_DOS_ERRORS
    
    metze

commit a7e418dd45fe81af4ec4fbddfcfffb491487a8b7
Author: Stefan Metzmacher <[email protected]>
Date:   Thu Sep 8 09:49:26 2011 +0200

    s3:libsmb: add CLI_FULL_CONNECTION_FORCE_ASCII
    
    metze

commit db79aa7260759c451e38e2df46562d01ce5514c6
Author: Stefan Metzmacher <[email protected]>
Date:   Thu Sep 8 09:18:45 2011 +0200

    s3:libsmb: add CLI_FULL_CONNECTION_FORCE_DOS_ERRORS
    
    metze

commit 189266d8eedae1a1c78776fdbbd0883b7390107f
Author: Stefan Metzmacher <[email protected]>
Date:   Thu Sep 8 17:26:30 2011 +0200

    s3:libsmb: don't handle CLI_FULL_CONNECTION_* flags in cli_full_connection()
    
    This is already done by cli_state_create().
    
    metze

commit 39ffa0b789b9733bad77d524ba9df6ee5a9098f2
Author: Stefan Metzmacher <[email protected]>
Date:   Thu Sep 8 17:26:30 2011 +0200

    s3:libsmb: don't handle CLI_FULL_CONNECTION_* flags in 
cli_start_connection()
    
    This is already done by cli_state_create().
    
    metze

-----------------------------------------------------------------------

Summary of changes:
 source3/include/client.h    |    3 +++
 source3/libsmb/cliconnect.c |   20 ++------------------
 source3/libsmb/clientgen.c  |   13 ++++++++++++-
 source3/torture/torture.c   |   24 +++++++++++++++++++-----
 4 files changed, 36 insertions(+), 24 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/include/client.h b/source3/include/client.h
index 79ce709..9eae222 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. */
@@ -193,5 +194,7 @@ struct file_info {
 #define CLI_FULL_CONNECTION_OPLOCKS 0x0010
 #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 58cf7a8..fd0536c 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);
 }
@@ -2911,19 +2912,6 @@ NTSTATUS cli_start_connection(struct cli_state 
**output_cli,
                return nt_status;
        }
 
-       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;
-       }
-
        nt_status = cli_negprot(cli);
        if (!NT_STATUS_IS_OK(nt_status)) {
                DEBUG(1, ("failed negprot: %s\n", nt_errstr(nt_status)));
@@ -2976,10 +2964,6 @@ NTSTATUS cli_full_connection(struct cli_state 
**output_cli,
                return nt_status;
        }
 
-       cli->use_oplocks = ((flags & CLI_FULL_CONNECTION_OPLOCKS) != 0);
-       cli->use_level_II_oplocks =
-               ((flags & CLI_FULL_CONNECTION_LEVEL_II_OPLOCKS) != 0);
-
        nt_status = cli_session_setup(cli, user, password, pw_len, password,
                                      pw_len, domain);
        if (!NT_STATUS_IS_OK(nt_status)) {
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c
index 20b64b6..f274dc0 100644
--- a/source3/libsmb/clientgen.c
+++ b/source3/libsmb/clientgen.c
@@ -201,8 +201,19 @@ struct cli_state *cli_state_create(TALLOC_CTX *mem_ctx,
        /* 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. */    
-       if (getenv("CLI_FORCE_DOSERR"))
+       if (getenv("CLI_FORCE_DOSERR")) {
                cli->force_dos_errors = true;
+       }
+       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;
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index 495875b..886c58e 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -56,7 +56,9 @@ static fstring randomfname;
 static bool use_oplocks;
 static bool use_level_II_oplocks;
 static const char *client_txt = "client_oplocks.txt";
+static bool disable_spnego;
 static bool use_kerberos;
+static bool force_dos_errors;
 static fstring multishare_conn_fname;
 static bool use_multishare_conn = False;
 static bool do_encrypt;
@@ -183,6 +185,10 @@ static struct cli_state *open_nbt_connection(void)
        NTSTATUS status;
        int flags = 0;
 
+       if (disable_spnego) {
+               flags |= CLI_FULL_CONNECTION_DONT_SPNEGO;
+       }
+
        if (use_oplocks) {
                flags |= CLI_FULL_CONNECTION_OPLOCKS;
        }
@@ -195,6 +201,10 @@ static struct cli_state *open_nbt_connection(void)
                flags |= CLI_FULL_CONNECTION_USE_KERBEROS;
        }
 
+       if (force_dos_errors) {
+               flags |= CLI_FULL_CONNECTION_FORCE_DOS_ERRORS;
+       }
+
        status = cli_connect_nb(host, NULL, port_to_use, 0x20, myname,
                                signing_state, flags, &c);
        if (!NT_STATUS_IS_OK(status)) {
@@ -6287,11 +6297,12 @@ static bool run_error_map_extract(int dummy) {
 
        /* NT-Error connection */
 
+       disable_spnego = true;
        if (!(c_nt = open_nbt_connection())) {
+               disable_spnego = false;
                return False;
        }
-
-       c_nt->use_spnego = False;
+       disable_spnego = false;
 
        status = cli_negprot(c_nt);
 
@@ -6310,12 +6321,15 @@ static bool run_error_map_extract(int dummy) {
 
        /* DOS-Error connection */
 
+       disable_spnego = true;
+       force_dos_errors = true;
        if (!(c_dos = open_nbt_connection())) {
+               disable_spnego = false;
+               force_dos_errors = false;
                return False;
        }
-
-       c_dos->use_spnego = False;
-       c_dos->force_dos_errors = True;
+       disable_spnego = false;
+       force_dos_errors = false;
 
        status = cli_negprot(c_dos);
        if (!NT_STATUS_IS_OK(status)) {


-- 
Samba Shared Repository

Reply via email to