Commit 3e987837 authored by Per Cederqvist's avatar Per Cederqvist

Don't hang if "Use DNS" is off. (Bug 1318.) Thanks to Rasmus

Sten who reported the bug and proposed an alternate fix.
* src/server/connections.c (login_request): Don't hang if the "Use
DNS" option is false.  (Bug 1318).  Log a warning message if
isc_resolve_remote() fails.
(src/server/testsuite/lyskomd.0/bug-1318.exp): New file.  Test the
"Use DNS: off" configuration option.
parent efa7c6b0
2005-12-22 Per Cederqvist <ceder@lysator.liu.se>
Don't hang if "Use DNS" is off. (Bug 1318.) Thanks to Rasmus
Sten who reported the bug and proposed an alternate fix.
* src/server/connections.c (login_request): Don't hang if the "Use
DNS" option is false. (Bug 1318). Log a warning message if
isc_resolve_remote() fails.
(src/server/testsuite/lyskomd.0/bug-1318.exp): New file. Test the
"Use DNS: off" configuration option.
2005-12-21 Per Cederqvist <ceder@lysator.liu.se>
"make check" without a previous "make" failed, because
......
......@@ -838,6 +838,7 @@ login_request(struct isc_scb *session)
char portbuf[1+2+3*sizeof(long)];
size_t portlen;
char *remote_ip = NULL;
Bool dns_submitted = FALSE;
/* Supress logins if /etc/nologin exists */
if (fexists(param.nologin_file))
......@@ -861,10 +862,27 @@ login_request(struct isc_scb *session)
remote_ip = s_crea_c_str(cp->remote_ip);
/* Initiate DNS lookup. */
if (param.use_dns && isc_resolve_remote(session, dns_resolution) == 0)
update_stat(STAT_DNS_QUEUE, 1);
else
if (param.use_dns)
{
int rv = isc_resolve_remote(session, dns_resolution);
if (rv == 0)
{
dns_submitted = TRUE;
update_stat(STAT_DNS_QUEUE, 1);
}
else
{
kom_log("WNG: isc_resolve_remote of %s failed: %s\n",
remote_ip, strerror(rv));
}
}
if (!dns_submitted)
{
s_strcpy(&session->remote, cp->remote_ip);
cp->blocked_by_dns = FALSE;
cp->dns_done = TRUE;
}
/* Update the status file that contains all connection. */
sprintf(portbuf, " %d", isc_getportnum(session->raddr));
......
# Test suite for lyskomd.
# Copyright (C) 2005 Lysator Academic Computer Association.
#
# This file is part of the LysKOM server.
#
# LysKOM is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 1, or (at your option)
# any later version.
#
# LysKOM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with LysKOM; see the file COPYING. If not, write to
# Lysator, c/o ISY, Linkoping University, S-581 83 Linkoping, SWEDEN,
# or the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
# MA 02139, USA.
#
# Please report bugs at http://bugzilla.lysator.liu.se/.
# Test the "Use DNS: off" configuration option.
lyskomd_start "" "Use DNS: off"
client_start 0
talk_to client 0
send "A[holl "DejaGnu test suite"]\n"
simple_expect "LysKOM" "MSHIP: Connected"
send "1000 80 0 { }\n"
simple_expect "=1000"
send "1001 0 5 [holl "gazonk"]\n"
simple_expect "=1001"
send "1002 42 255\n"
simple_expect "=1002"
send "1003 44 0\n"
simple_expect "=1003"
client_death 0
lyskomd_death
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment