1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

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
This commit is contained in:
Stefan Metzmacher 2013-12-11 15:02:27 +01:00 committed by Volker Lendecke
parent fd722494e7
commit 0c7f36d299

View File

@ -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);
}