From 091a92e9962a9526dd355b8f6c2e57b0fba167ab Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 21 Nov 1998 01:28:15 +0000 Subject: try to use *SMBSERVER to connect to password server if the first session_request fails. (This used to be commit ab2370e7ac770f1e32b8d726ab955457fcc8c2d7) --- source3/smbd/password.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/source3/smbd/password.c b/source3/smbd/password.c index 683303ff87..8b73ff4518 100644 --- a/source3/smbd/password.c +++ b/source3/smbd/password.c @@ -1000,21 +1000,19 @@ struct cli_state *server_cryptkey(void) } make_nmb_name(&calling, local_machine, 0x0 , scope); + make_nmb_name(&called , desthost , 0x20, scope); - if(strlen(desthost) > 15) - { - DEBUG(1,("server_cryptkey: %s is too long for a password server NetBIOS \ -name, using *SMBSERVER for the connection.\n", desthost )); - make_nmb_name(&called , "*SMBSERVER", 0x20, scope); - } - else - make_nmb_name(&called , desthost , 0x20, scope); - - if (!cli_session_request(cli, &calling, &called)) - { - DEBUG(1,("%s rejected the session\n",desthost)); + if (!cli_session_request(cli, &calling, &called)) { + /* try with *SMBSERVER if the first name fails */ cli_shutdown(cli); - return NULL; + make_nmb_name(&called , "*SMBSERVER", 0x20, scope); + if (!cli_initialise(cli) || + !cli_connect(cli, desthost, &dest_ip) || + !cli_session_request(cli, &calling, &called)) { + DEBUG(1,("%s rejected the session\n",desthost)); + cli_shutdown(cli); + return NULL; + } } DEBUG(3,("got session\n")); -- cgit