From owner-cvs-lib Mon Aug 14 16:53:04 1995 Return-Path: cvs-lib-owner Received: (from majordom@localhost) by freefall.FreeBSD.org (8.6.11/8.6.6) id QAA10652 for cvs-lib-outgoing; Mon, 14 Aug 1995 16:53:04 -0700 Received: (from wpaul@localhost) by freefall.FreeBSD.org (8.6.11/8.6.6) id QAA10635 ; Mon, 14 Aug 1995 16:52:51 -0700 Date: Mon, 14 Aug 1995 16:52:51 -0700 From: Bill Paul Message-Id: <199508142352.QAA10635@freefall.FreeBSD.org> To: CVS-commiters, cvs-lib Subject: cvs commit: src/lib/libc/net rcmd.c Sender: cvs-lib-owner@freebsd.org Precedence: bulk wpaul 95/08/14 16:52:50 Modified: lib/libc/net rcmd.c Log: Submitted by: Bill Fenner Fix for PR #510. The original problem was that __ivaliduser() was failing to grant access to a machine listed in a +@netgroup specified in /etc/hosts.equiv, even though the host being checked was most certainly in the +@netgroup. The /etc/hosts.equiv file in question looked like this: localhost +@netgroup The reason for the failure was had to do with gethostbyaddr(). Inside the __ivaliduser() routine, we need to do a gethostbyaddr() in order to get back the actual name of the host we're trying to validate since we're only passed its IP address. The hostname returned by gethostbyaddr() is later passed as an argument to innetgr(). The problem is that __icheckhost() later does a gethostbyname() of its own, which clobbers the buffer returned by gethostbyaddr(). The fix is just to copy the hostname into a private buffer and use _that_ as the 'host' argument that gets passed to innetgr(). And here I was crawling all over the innetgr() code thinking the problem was there. *sigh*