From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 29 06:38:57 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D1A2E16A4D4 for ; Wed, 29 Oct 2003 06:38:57 -0800 (PST) Received: from bast.unixathome.org (bast.unixathome.org [66.11.174.150]) by mx1.FreeBSD.org (Postfix) with ESMTP id C2CA943F3F for ; Wed, 29 Oct 2003 06:38:55 -0800 (PST) (envelope-from dan@langille.org) Received: from wocker (wocker.unixathome.org [192.168.0.99]) by bast.unixathome.org (Postfix) with ESMTP id 979233D29 for ; Wed, 29 Oct 2003 09:38:50 -0500 (EST) From: "Dan Langille" To: FreeBSD-hackers@freebsd.org Date: Wed, 29 Oct 2003 09:38:50 -0500 MIME-Version: 1.0 Message-ID: <3F9F8AAA.12507.14D8EE23@localhost> Priority: normal X-mailer: Pegasus Mail for Windows (v4.02a) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body Subject: hosts_access(3) - correct usage? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2003 14:38:58 -0000 Is this the right way to use hosts_access? The code blows up during the hosts_access call. I'm told it runs OK on Linux/Solaris. I'm wonderding if there's something different it needs to do be doing on FreeBSD. Thanks #ifdef HAVE_LIBWRAP P(mutex); /* hosts_access is not thread safe */ request_init(&request, RQ_DAEMON, my_name, RQ_FILE, newsockfd, 0); fromhost(&request); if (!hosts_access(&request)) { V(mutex); Jmsg2(NULL, M_WARNING, 0, _("Connection from %s:%d refused by hosts.access"), inet_ntoa(cli_addr.sin_addr), ntohs(cli_addr.sin_port)); close(newsockfd); continue; } V(mutex); #endif -- Dan Langille : http://www.langille.org/