Add a bad hack to enable level 2 oplocks in torture_open_connection_share
authorVolker Lendecke <vl@samba.org>
Mon, 6 Apr 2009 18:45:08 +0000 (20:45 +0200)
committerVolker Lendecke <vl@samba.org>
Mon, 6 Apr 2009 19:32:08 +0000 (21:32 +0200)
source3/include/client.h
source3/libsmb/cliconnect.c
source3/torture/torture.c

index 3461dfa47abe93fbd907ad40b93049632197310f..c314c9c6a98978fc7278fecb4234b29d22789d2a 100644 (file)
@@ -289,5 +289,7 @@ typedef struct file_info {
 #define CLI_FULL_CONNECTION_USE_KERBEROS 0x0002
 #define CLI_FULL_CONNECTION_ANONYMOUS_FALLBACK 0x0004
 #define CLI_FULL_CONNECTION_FALLBACK_AFTER_KERBEROS 0x0008
+#define CLI_FULL_CONNECTION_OPLOCKS 0x0010
+#define CLI_FULL_CONNECTION_LEVEL_II_OPLOCKS 0x0020
 
 #endif /* _CLIENT_H */
index 34c0825c079f6546b67d6ddd4c03de2d4b020cc1..53a812d222f5a14acf3542ee6e3b0512b7a97636 100644 (file)
@@ -2169,6 +2169,10 @@ 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)) {
index 22e1104d79efa8a580858ddb4d19579e46290c71..804e77251638238937bf4451e95562695a2a64c6 100644 (file)
@@ -273,6 +273,10 @@ static bool torture_open_connection_share(struct cli_state **c,
 
        if (use_kerberos)
                flags |= CLI_FULL_CONNECTION_USE_KERBEROS;
+       if (use_oplocks)
+               flags |= CLI_FULL_CONNECTION_OPLOCKS;
+       if (use_level_II_oplocks)
+               flags |= CLI_FULL_CONNECTION_LEVEL_II_OPLOCKS;
 
        status = cli_full_connection(c, myname,
                                     hostname, NULL, port_to_use, 
@@ -285,8 +289,6 @@ static bool torture_open_connection_share(struct cli_state **c,
                return False;
        }
 
-       if (use_oplocks) (*c)->use_oplocks = True;
-       if (use_level_II_oplocks) (*c)->use_level_II_oplocks = True;
        (*c)->timeout = 120000; /* set a really long timeout (2 minutes) */
 
        if (do_encrypt) {