]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:torture: add torture_open_connection_flags()
authorStefan Metzmacher <metze@samba.org>
Mon, 19 Jun 2017 08:00:15 +0000 (10:00 +0200)
committerStefan Metzmacher <metze@samba.org>
Thu, 22 Jun 2017 11:07:41 +0000 (13:07 +0200)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/torture/proto.h
source3/torture/torture.c

index 6d5ca7747e194ac51590370a193db91fa5ea19ce..4c3e5401ce00ce636d77831545ab6bde3dd30550 100644 (file)
@@ -65,6 +65,7 @@ bool torture_nttrans_scan(int dummy);
 
 bool smbcli_parse_unc(const char *unc_name, TALLOC_CTX *mem_ctx,
                      char **hostname, char **sharename);
+bool torture_open_connection_flags(struct cli_state **c, int conn_index, int flags);
 bool torture_open_connection(struct cli_state **c, int conn_index);
 bool torture_init_connection(struct cli_state **pcli);
 bool torture_cli_session_setup2(struct cli_state *cli, uint16_t *new_vuid);
index 2f4e68499839baa144e2a0b54552b12be3688768..10e450ee4a772da87f72ba9270ecf25817b52e82 100644 (file)
@@ -356,19 +356,11 @@ static bool torture_open_connection_share(struct cli_state **c,
        return True;
 }
 
-bool torture_open_connection(struct cli_state **c, int conn_index)
+bool torture_open_connection_flags(struct cli_state **c, int conn_index, int flags)
 {
        char **unc_list = NULL;
        int num_unc_names = 0;
        bool result;
-       int flags = CLI_FULL_CONNECTION_FORCE_SMB1;
-
-       if (use_oplocks) {
-               flags |= CLI_FULL_CONNECTION_OPLOCKS;
-       }
-       if (use_level_II_oplocks) {
-               flags |= CLI_FULL_CONNECTION_LEVEL_II_OPLOCKS;
-       }
 
        if (use_multishare_conn==True) {
                char *h, *s;
@@ -396,6 +388,20 @@ bool torture_open_connection(struct cli_state **c, int conn_index)
        return torture_open_connection_share(c, host, share, flags);
 }
 
+bool torture_open_connection(struct cli_state **c, int conn_index)
+{
+       int flags = CLI_FULL_CONNECTION_FORCE_SMB1;
+
+       if (use_oplocks) {
+               flags |= CLI_FULL_CONNECTION_OPLOCKS;
+       }
+       if (use_level_II_oplocks) {
+               flags |= CLI_FULL_CONNECTION_LEVEL_II_OPLOCKS;
+       }
+
+       return torture_open_connection_flags(c, conn_index, flags);
+}
+
 bool torture_init_connection(struct cli_state **pcli)
 {
        struct cli_state *cli;