summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1997-09-04 21:23:27 +0000
committerJeremy Allison <jra@samba.org>1997-09-04 21:23:27 +0000
commitab68ac375ee5c175366123617887a725498efddc (patch)
tree1c16cee37fa86c5be2367e719fb807a0ef3fe4cf /source3
parentf5302af621d91536a72b437ae2b80f9dedb46920 (diff)
downloadsamba-ab68ac375ee5c175366123617887a725498efddc.tar.gz
samba-ab68ac375ee5c175366123617887a725498efddc.tar.bz2
samba-ab68ac375ee5c175366123617887a725498efddc.zip
Fix from Frank Varnavas <varnavas@ny.ubs.com>.
We cannot use the same name as the client to the NT password server, as NT will drop client connections if the same client name connects twice. Instead, synthesize a name from our pid. and the remote machine name. Jeremy (jallison@whistle.com) (This used to be commit ebf9487a9a68c4d786449490627ee919622e6dbf)
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/password.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/source3/smbd/password.c b/source3/smbd/password.c
index 2740304cc4..ed79d658a6 100644
--- a/source3/smbd/password.c
+++ b/source3/smbd/password.c
@@ -1576,11 +1576,25 @@ BOOL server_cryptkey(char *buf)
p = outbuf+len;
name_mangle(desthost,p,' ');
len += name_len(p);
+ p = outbuf+len;
/* and my name */
- p = outbuf+len;
- name_mangle(remote_machine,p,' ');
- len += name_len(p);
+ /* Fix from Frank Varnavas <varnavas@ny.ubs.com>.
+ We cannot use the same name as the client to
+ the NT password server, as NT will drop client
+ connections if the same client name connects
+ twice. Instead, synthesize a name from our pid.
+ and the remote machine name.
+ */
+ {
+ char buf[32]; /* create name as PIDname */
+ sprintf(buf,"%d", getpid());
+ strncpy(&buf[strlen(buf)], remote_machine, 31 - strlen(buf));
+ buf[31] = '\0';
+ DEBUG(1,("negprot w/password server as %s\n",buf));
+ name_mangle(buf,p,' ');
+ len += name_len(p);
+ }
_smb_setlen(outbuf,len);
CVAL(outbuf,0) = 0x81;