diff options
author | Stefan Metzmacher <metze@samba.org> | 2017-06-19 10:00:15 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2017-06-22 13:07:41 +0200 |
commit | 740c2dad3e4dd3d5f2b408ccdb751ae96527e3d5 (patch) | |
tree | 395893321783bf686ae1ee05f6d7c312a27d7dd7 /source3 | |
parent | 0a81af6824c72b52b4be42003401741132f41b79 (diff) | |
download | samba-740c2dad3e4dd3d5f2b408ccdb751ae96527e3d5.tar.gz |
s3:torture: add torture_open_connection_flags()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3')
-rw-r--r-- | source3/torture/proto.h | 1 | ||||
-rw-r--r-- | source3/torture/torture.c | 24 |
2 files changed, 16 insertions, 9 deletions
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; |