diff options
author | Stefan Metzmacher <metze@samba.org> | 2013-12-11 15:02:27 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2013-12-14 20:19:10 +0100 |
commit | 0c7f36d299caa80785514939fd45be8377d8faf4 (patch) | |
tree | 3646f0f60a20b4617130d0438707ef25345c1875 /source3/smbd/process.c | |
parent | fd722494e7b5add462af5163315d85344a775f1f (diff) | |
download | samba-0c7f36d299caa80785514939fd45be8377d8faf4.tar.gz samba-0c7f36d299caa80785514939fd45be8377d8faf4.tar.xz samba-0c7f36d299caa80785514939fd45be8377d8faf4.zip |
s3:smbd: avoid calling fd_is_readable() without async echo handler
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Sat Dec 14 20:19:10 CET 2013 on sn-devel-104
Diffstat (limited to 'source3/smbd/process.c')
-rw-r--r-- | source3/smbd/process.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/source3/smbd/process.c b/source3/smbd/process.c index 7d9f7671927..8bd1c2e0497 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -2383,21 +2383,23 @@ static void smbd_server_connection_read_handler( NTSTATUS status; uint32_t seqnum; - bool from_client; + bool async_echo = lp_async_smb_echo_handler(); + bool from_client = false; - if (lp_async_smb_echo_handler() - && fd_is_readable(sconn->smb1.echo_handler.trusted_fd)) { - /* - * This is the super-ugly hack to prefer the packets - * forwarded by the echo handler over the ones by the - * client directly - */ - fd = sconn->smb1.echo_handler.trusted_fd; + if (async_echo) { + if (fd_is_readable(sconn->smb1.echo_handler.trusted_fd)) { + /* + * This is the super-ugly hack to prefer the packets + * forwarded by the echo handler over the ones by the + * client directly + */ + fd = sconn->smb1.echo_handler.trusted_fd; + } } from_client = (sconn->sock == fd); - if (from_client) { + if (async_echo && from_client) { smbd_lock_socket(sconn); if (!fd_is_readable(fd)) { @@ -2416,7 +2418,7 @@ static void smbd_server_connection_read_handler( &inbuf_len, &seqnum, !from_client /* trusted channel */); - if (from_client) { + if (async_echo && from_client) { smbd_unlock_socket(sconn); } |