From 460339db2246b0213252ee34f507eb8e55ecbecb Mon Sep 17 00:00:00 2001 From: Richard Sharpe Date: Wed, 5 Mar 2003 23:55:11 +0000 Subject: [PATCH] Add *SMBSERVER fallback code to smbtorture ... --- source/torture/torture.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/source/torture/torture.c b/source/torture/torture.c index 1744d3109c1..2f779b9c893 100644 --- a/source/torture/torture.c +++ b/source/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; -- 2.11.4.GIT