From owner-freebsd-arch Sat Sep 2 11: 6:11 2000 Delivered-To: freebsd-arch@freebsd.org Received: from verdi.nethelp.no (verdi.nethelp.no [158.36.41.162]) by hub.freebsd.org (Postfix) with SMTP id B048237B43C for ; Sat, 2 Sep 2000 11:06:08 -0700 (PDT) Received: (qmail 61645 invoked by uid 1001); 2 Sep 2000 18:06:06 +0000 (GMT) To: phk@critter.freebsd.dk Cc: n@nectar.com, ume@FreeBSD.ORG, arch@FreeBSD.ORG Subject: Re: Request for review: nsswitch From: sthaug@nethelp.no In-Reply-To: Your message of "Sat, 02 Sep 2000 19:02:46 +0200" References: <41094.967914166@critter> X-Mailer: Mew version 1.05+ on Emacs 19.34.2 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Date: Sat, 02 Sep 2000 20:06:06 +0200 Message-ID: <61643.967917966@verdi.nethelp.no> Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > Since we're on this topic anyway, there is one thing which has always > bothered me: Why don't we have the option of a per user alias file > for hostnames ? > > I would love to be able to say: > > echo "freefall freefall.freebsd.org" >> $HOME/.hostaliases > > and be able to say just: > > ssh freefall > > no matter how the local resolver and/or /etc/hosts file were configured... The mechanism already exists. See libc/net/res_query.c, the hostalias() routine: if (_res.options & RES_NOALIASES) return (NULL); if (issetugid()) return (NULL); file = getenv("HOSTALIASES"); and the environment variable needs to point to a file with lines in the format short-name full.name.dom.ain As you can see, it is explicitly disabled for setuid programs. It works for ssh as soon as you make ssh non-setuid (which I think is a good idea in any case...) Steinar Haug, Nethelp consulting, sthaug@nethelp.no To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message