From 6149dfd3e7b9848720d18ad2c095b1f5e58ffd86 Mon Sep 17 00:00:00 2001 From: Richard Sharpe Date: Wed, 5 Mar 2003 23:55:11 +0000 Subject: Add *SMBSERVER fallback code to smbtorture ... (This used to be commit 460339db2246b0213252ee34f507eb8e55ecbecb) --- source3/torture/torture.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'source3/torture') diff --git a/source3/torture/torture.c b/source3/torture/torture.c index 1744d3109c..2f779b9c89 100644 --- a/source3/torture/torture.c +++ b/source3/torture/torture.c @@ -124,9 +124,23 @@ static BOOL open_nbt_connection(struct cli_state *c) if (use_level_II_oplocks) c->use_level_II_oplocks = True; if (!cli_session_request(c, &calling, &called)) { - printf("%s rejected the session\n",host); - cli_shutdown(c); - return False; + /* + * Well, that failed, try *SMBSERVER ... + * However, we must reconnect as well ... + */ + if (!cli_connect(c, host, &ip)) { + printf("Failed to connect with %s\n", host); + return False; + } + + make_nmb_name(&called, "*SMBSERVER", 0x20); + if (!cli_session_request(c, &calling, &called)) { + printf("%s rejected the session\n",host); + printf("We tried with a called name of %s & %s\n", + host, "*SMBSERVER"); + cli_shutdown(c); + return False; + } } return True; -- cgit