diff options
author | Andrew Tridgell <tridge@samba.org> | 2000-04-11 13:55:53 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2000-04-11 13:55:53 +0000 |
commit | 2fa922611bf7160e2c1ce80c11b50006448bf98d (patch) | |
tree | ed29a6f6c0364ee631b049b26031139b9e74a4ec /source3/smbd/trans2.c | |
parent | 03630a9aa9ce5c00619ad3c4bb498d95054ae03a (diff) | |
download | samba-2fa922611bf7160e2c1ce80c11b50006448bf98d.tar.gz samba-2fa922611bf7160e2c1ce80c11b50006448bf98d.tar.bz2 samba-2fa922611bf7160e2c1ce80c11b50006448bf98d.zip |
finally got sick of the "extern int Client" code and the stupid
assumption that we have one socket everywhere
while doing so I discovered a few bugs!
1) the clientgen session retarget code if used from smbd or nmbd would
cause a crash as it called close_sockets() which closed our main
socket! fixed by removing close_sockets() completely - it is unnecessary
2) the caching in client_addr() and client_name() was bogus - it could
easily get fooled and give the wrong result. fixed.
3) the retarget could could recurse, allowing an easy denial of
service attack on nmbd. fixed.
(This used to be commit 5937ab14d222696e40a3fc6f0e6a536f2d7305d3)
Diffstat (limited to 'source3/smbd/trans2.c')
-rw-r--r-- | source3/smbd/trans2.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index f1fa30b0c6..2ca06ab746 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -27,7 +27,6 @@ extern int DEBUGLEVEL; extern int Protocol; extern BOOL case_sensitive; -extern int Client; extern int smb_read_error; extern fstring local_machine; extern int global_oplock_break; @@ -66,7 +65,7 @@ static int send_trans2_replies(char *outbuf, int bufsize, char *params, the empty packet */ if(params_to_send == 0 && data_to_send == 0) { - send_smb(Client,outbuf); + send_smb(smbd_server_fd(),outbuf); return 0; } @@ -161,7 +160,7 @@ static int send_trans2_replies(char *outbuf, int bufsize, char *params, params_to_send, data_to_send, paramsize, datasize)); /* Send the packet */ - send_smb(Client,outbuf); + send_smb(smbd_server_fd(),outbuf); pp += params_sent_thistime; pd += data_sent_thistime; @@ -2288,7 +2287,7 @@ int reply_trans2(connection_struct *conn, /* We need to send an interim response then receive the rest of the parameter/data bytes */ outsize = set_message(outbuf,0,0,True); - send_smb(Client,outbuf); + send_smb(smbd_server_fd(),outbuf); while (num_data_sofar < total_data || num_params_sofar < total_params) { |