From owner-freebsd-commit Tue Feb 13 19:18:27 1996 Return-Path: owner-commit Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id TAA00753 for freebsd-commit-outgoing; Tue, 13 Feb 1996 19:18:27 -0800 (PST) Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id TAA00733 for cvs-all-outgoing; Tue, 13 Feb 1996 19:18:14 -0800 (PST) Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id TAA00724 for cvs-gnu-outgoing; Tue, 13 Feb 1996 19:18:12 -0800 (PST) Received: from precipice.shockwave.com (precipice.shockwave.com [171.69.108.33]) by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id TAA00699 Tue, 13 Feb 1996 19:17:58 -0800 (PST) Received: from localhost.shockwave.com (localhost.shockwave.com [127.0.0.1]) by precipice.shockwave.com (8.7.3/8.7.3) with SMTP id TAA09897; Tue, 13 Feb 1996 19:17:14 -0800 (PST) Message-Id: <199602140317.TAA09897@precipice.shockwave.com> To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch) cc: CVS-committers@freefall.freebsd.org, cvs-gnu@freefall.freebsd.org Subject: Re: cvs commit: src/gnu/usr.bin/perl/lib gethostname.pl Makefile In-reply-to: Your message of "Wed, 14 Feb 1996 00:00:29 +0100." <199602132300.AAA06395@uriah.heep.sax.de> Date: Tue, 13 Feb 1996 19:17:14 -0800 From: Paul Traina Sender: owner-commit@FreeBSD.ORG Precedence: bulk Why don't you just add it to perl? :-) From: J Wunsch Subject: Re: cvs commit: src/gnu/usr.bin/perl/lib gethostname.pl Makefile 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. ;-)