fix the use of the libwrap methods:

-fromhost() doesn't work because the file descriptor isn't available
 at this point, see PR bin/6813
-it needs some initialization for libwrap to grok the IP address and/or
 host names in its rule files (see PR bin/6831 by Andreas Wrede
 <andreas@planix.com>, the fix is different)
Needless to say that libwrap's interface sucks.
This commit is contained in:
drochner 1999-01-18 19:47:36 +00:00
parent 05c9a1f2b5
commit e755eb28ce
1 changed files with 3 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: portmap.c,v 1.16 1999/01/16 20:59:05 hannken Exp $ */
/* $NetBSD: portmap.c,v 1.17 1999/01/18 19:47:36 drochner Exp $ */
/*-
* Copyright (c) 1990, 1993
@ -44,7 +44,7 @@ __COPYRIGHT(
#if 0
static char sccsid[] = "@(#)portmap.c 8.1 (Berkeley) 6/6/93";
#else
__RCSID("$NetBSD: portmap.c,v 1.16 1999/01/16 20:59:05 hannken Exp $");
__RCSID("$NetBSD: portmap.c,v 1.17 1999/01/18 19:47:36 drochner Exp $");
#endif
#endif /* not lint */
@ -660,7 +660,7 @@ check_access(addr, proc, prog)
#ifdef LIBWRAP
request_init(&req, RQ_DAEMON, "portmap", RQ_CLIENT_SIN, addr, 0);
fromhost(&req);
sock_methods(&req);
if(!hosts_access(&req)) {
logit(deny_severity, addr, proc, prog, ": request from unauthorized host");
return 0;