www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/05/13/18:15:05

Sender: richdawe AT bigfoot DOT com
Message-ID: <373B413E.3B1D210D@bigfoot.com>
Date: Thu, 13 May 1999 22:16:46 +0100
From: Richard Dawe <richdawe AT bigfoot DOT com>
X-Mailer: Mozilla 4.08 [en] (X11; I; Linux 2.2.1 i586)
MIME-Version: 1.0
To: DJGPP workers <djgpp-workers AT delorie DOT com>
Subject: Re: $HOSTNAME doesn't override library code
References: <Pine DOT SUN DOT 3 DOT 91 DOT 990513155446 DOT 12629D-100000 AT is>
Reply-To: djgpp-workers AT delorie DOT com

> The value of $HOSTNAME is a fallback, not an override.  The code calls
> the network-aware function which returns whatever name you system has
> been configured to.  This is what a Unix machine would do as well.

This seems reasonable on a re-think.

> There's no contradiction: $USER overrides the default "dosuser"
> exactly as $HOSTNAME overrides the default "pc".  The difference is
> that in the case of gethostname there is a DOS function that returns
> the actual name of a machine, whereas there's no DOS function that
> returns the name of the user.  So the call to Int 21h/AH=5Eh is *in
> addition* to the environment override.

The name returned is a LAN Manager name, which doesn't necessarily bear
any relation to the DNS name. From this point of view, it would be useful
to be able to override the host name. For instance, if one was using DJGPP
programs to call Win32 or other network-aware programs, there could be
problems. I guess by not having the same LAN Manager and DNS names, one is
asking for trouble.

I suppose if one was really concerned with this, one would just use
libsocket or equivalent.

[ BTW Eli, I'm on the workers list, so don't worry about cc'ing me. ]

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019