diff options
author | Luke Leighton <lkcl@samba.org> | 1999-09-08 19:37:45 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 1999-09-08 19:37:45 +0000 |
commit | 7f8f5e15bdffec00454168c0591fa39a88d191c2 (patch) | |
tree | 25faae6d6dc80106bd4dacf323488af4517e0583 /source3/smbd/process.c | |
parent | 58f8159566e49df82be1ed0ade83821a184b9203 (diff) | |
download | samba-7f8f5e15bdffec00454168c0591fa39a88d191c2.tar.gz samba-7f8f5e15bdffec00454168c0591fa39a88d191c2.tar.bz2 samba-7f8f5e15bdffec00454168c0591fa39a88d191c2.zip |
bertl <bs@niggard.org> patch for making samba listen on port 445, just like
nt 5 does. cool!
(This used to be commit 727e1421b2c0f8c72c428776593498103304082b)
Diffstat (limited to 'source3/smbd/process.c')
-rw-r--r-- | source3/smbd/process.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/source3/smbd/process.c b/source3/smbd/process.c index bc60cb474d..13dd932a57 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -746,6 +746,7 @@ int chain_reply(char *inbuf,char *outbuf,int size,int bufsize) void smbd_process(void) { extern int Client; + extern int ClientPort; InBuffer = (char *)malloc(BUFFER_SIZE + SAFETY_MARGIN); OutBuffer = (char *)malloc(BUFFER_SIZE + SAFETY_MARGIN); @@ -772,6 +773,33 @@ void smbd_process(void) /* re-initialise the timezone */ TimeInit(); + /* if connection on port 445, fake session setup... */ + if(ClientPort == 445) + { + extern fstring remote_machine; + extern fstring local_machine; + char *s; + + fstrcpy(remote_machine, dns_to_netbios_name(client_name(Client))); + fstrcpy(local_machine, global_myname); + remote_machine[15] = 0; + local_machine[15] = 0; + strlower(remote_machine); + strlower(local_machine); + + DEBUG(2, ("smbd_process(): faking session setup\n" + "client_name: %s my_name: %s\n", remote_machine, local_machine)); + + add_session_user(remote_machine); + + reload_services(True); + reopen_logs(); + + if(lp_status(-1)) { + claim_connection(NULL,"STATUS.",MAXSTATUS,True); + } + } + while (True) { int deadtime = lp_deadtime()*60; |