summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1998-11-21 01:28:15 +0000
committerAndrew Tridgell <tridge@samba.org>1998-11-21 01:28:15 +0000
commit091a92e9962a9526dd355b8f6c2e57b0fba167ab (patch)
tree965d02f15622e87a20c62784def8ed9d9b0e299f /source3/smbd
parent58e14b7c0b329905f9981bbbc5867e061f1f22b7 (diff)
downloadsamba-091a92e9962a9526dd355b8f6c2e57b0fba167ab.tar.gz
samba-091a92e9962a9526dd355b8f6c2e57b0fba167ab.tar.bz2
samba-091a92e9962a9526dd355b8f6c2e57b0fba167ab.zip
try to use *SMBSERVER to connect to password server if the first
session_request fails. (This used to be commit ab2370e7ac770f1e32b8d726ab955457fcc8c2d7)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/password.c24
1 files 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"));