diff --git a/source3/torture/proto.h b/source3/torture/proto.h index 6d5ca7747e1..4c3e5401ce0 100644 --- a/source3/torture/proto.h +++ b/source3/torture/proto.h @@ -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); diff --git a/source3/torture/torture.c b/source3/torture/torture.c index 2f4e6849983..10e450ee4a7 100644 --- a/source3/torture/torture.c +++ b/source3/torture/torture.c @@ -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;