mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
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 commit is contained in:
parent
99080705a2
commit
ebf9487a9a
@ -1576,11 +1576,25 @@ BOOL server_cryptkey(char *buf)
|
|||||||
p = outbuf+len;
|
p = outbuf+len;
|
||||||
name_mangle(desthost,p,' ');
|
name_mangle(desthost,p,' ');
|
||||||
len += name_len(p);
|
len += name_len(p);
|
||||||
|
p = outbuf+len;
|
||||||
|
|
||||||
/* and my name */
|
/* and my name */
|
||||||
p = outbuf+len;
|
/* Fix from Frank Varnavas <varnavas@ny.ubs.com>.
|
||||||
name_mangle(remote_machine,p,' ');
|
We cannot use the same name as the client to
|
||||||
len += name_len(p);
|
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);
|
_smb_setlen(outbuf,len);
|
||||||
CVAL(outbuf,0) = 0x81;
|
CVAL(outbuf,0) = 0x81;
|
||||||
|
Loading…
Reference in New Issue
Block a user