Date: Tue, 4 Jul 2006 13:12:28 +0100 From: Brian Candler <B.Candler@pobox.com> To: Brooks Davis <brooks@one-eyed-alien.net> Cc: Mike Jakubik <mikej@rogers.com>, freebsd-current@freebsd.org, Garance A Drosihn <drosih@rpi.edu>, Stefan Bethke <stb@lassitu.de>, Justin Hibbits <jrh29@eecs.cwru.edu> Subject: Re: ~/.hosts patch Message-ID: <20060704121228.GA24152@uk.tiscali.com> In-Reply-To: <20060703215504.GC22556@odin.ac.hmc.edu> References: <C41481BC-89F3-457E-9FD0-CB85CE7B93E7@eecs.cwru.edu> <4498D108.90907@rogers.com> <20060621053007.GA3320@odin.ac.hmc.edu> <p06230963c0bf7fde2e33@[128.113.24.47]> <20060630213259.GA20670@odin.ac.hmc.edu> <953595BB-0939-4CCB-85B7-65F99F02275E@lassitu.de> <20060703215504.GC22556@odin.ac.hmc.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Jul 03, 2006 at 02:55:04PM -0700, Brooks Davis wrote: > The problem is that the client application using a port forwarded to > localhost:port via ssh must connect to that port via the host name of > the remote server or it will crash the remote server because it also > passes localhost or 127.0.0.1 to the remote server over the TCP session > and the server misbehaves in that case. Yes it's a bug in both the > remote server and the client/server protocol, but that's really beside > the point. Crappy software exists and sometimes we have to deal with > it. > > The simple fact is that I needed a hack like this and there wasn't > another solution (with possible exception of a SOCKS proxy, which wasn't > an option at the time) a ~/.hosts file would have been a nice way to > implement part of it rather than actually adding the entry to /etc/hosts. Well, assuming your client calls gethostbyname() then you could write a tiny library which always returns 127.0.0.1, and use LD_PRELOAD to load it beforehand. Another solution (which doesn't require coding) would be to run the application inside a jail, and either frig /etc/hosts there, or point resolv.conf to a nameserver inside the jail, which has a '*' A record mapping everything to 127.0.0.1 Regards, Brian.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060704121228.GA24152>