From owner-freebsd-commit Tue Feb 13 15:21:56 1996 Return-Path: owner-commit Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id PAA17434 for freebsd-commit-outgoing; Tue, 13 Feb 1996 15:21:56 -0800 (PST) Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id PAA17416 for cvs-all-outgoing; Tue, 13 Feb 1996 15:21:47 -0800 (PST) Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id PAA17405 for cvs-gnu-outgoing; Tue, 13 Feb 1996 15:21:44 -0800 (PST) Received: from irz301.inf.tu-dresden.de (irz301.inf.tu-dresden.de [141.76.1.11]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id PAA17397 Tue, 13 Feb 1996 15:21:33 -0800 (PST) Received: from sax.sax.de by irz301.inf.tu-dresden.de (8.6.12/8.6.12-s1) with ESMTP id AAA07812; Wed, 14 Feb 1996 00:21:28 +0100 Received: by sax.sax.de (8.6.11/8.6.12-s1) with UUCP id AAA19138; Wed, 14 Feb 1996 00:21:28 +0100 Received: (from j@localhost) by uriah.heep.sax.de (8.7.3/8.6.9) id AAA06395; Wed, 14 Feb 1996 00:00:29 +0100 (MET) From: J Wunsch Message-Id: <199602132300.AAA06395@uriah.heep.sax.de> Subject: Re: cvs commit: src/gnu/usr.bin/perl/lib gethostname.pl Makefile To: CVS-committers@freefall.freebsd.org, cvs-gnu@freefall.freebsd.org Date: Wed, 14 Feb 1996 00:00:29 +0100 (MET) Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch) In-Reply-To: <199602131750.KAA22891@rocky.sri.MT.net> from "Nate Williams" at Feb 13, 96 10:50:27 am X-Phone: +49-351-2012 669 X-Mailer: ELM [version 2.4 PL23] MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Sender: owner-commit@FreeBSD.ORG Precedence: bulk As Nate Williams wrote: > > Paul Traina writes: > > This is non-standard (albiet nice to have), which will make porting away > > from FBSD more difficult. Caveat Emptor. > > Unless you bring in the package with anything exported from FreeBSD. The problem is that there's no generic way for hooking gethostname(3) into a Perl script. I rather consider this an omission of Perl. Anyway, the simple solution: ------8<-----8<-----8<-----8<-----8<----- package gethostname; sub gethostname { return `hostname`; } 1; ------8<-----8<-----8<-----8<-----8<----- should always do the trick. My concern was to avoid the overhead from the additional process, and the fact that i don't like to call unneeded external programs at all in setuid scripts. -- cheers, J"org joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE Never trust an operating system you don't have sources for. ;-)