delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/2003/03/10/06:15:51

Mailing-List: contact cygwin-developers-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-developers-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin-developers/>
List-Post: <mailto:cygwin-developers AT cygwin DOT com>
List-Help: <mailto:cygwin-developers-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-developers-owner AT cygwin DOT com
Delivered-To: mailing list cygwin-developers AT cygwin DOT com
Date: Mon, 10 Mar 2003 12:15:48 +0100
From: Corinna Vinschen <vinschen AT redhat DOT com>
To: cygwin-developers AT cygwin DOT com
Subject: Re: gethostid anyone?
Message-ID: <20030310111548.GW1193@cygbert.vinschen.de>
Reply-To: cygwin-developers AT cygwin DOT com
Mail-Followup-To: cygwin-developers AT cygwin DOT com
References: <20030308050421 DOT GA27025 AT redhat DOT com> <LPEHIHGCJOAIPFLADJAHIEIADGAA DOT chris AT atomice DOT net>
Mime-Version: 1.0
In-Reply-To: <LPEHIHGCJOAIPFLADJAHIEIADGAA.chris@atomice.net>
User-Agent: Mutt/1.4i

On Mon, Mar 10, 2003 at 12:01:20AM -0000, Chris January wrote:
> > Anyone interested in implementing a working gethostid?  It should be
> > trivial to have it returned a munged IP address like linux but it
> > might be more interesting if it returned something more unique than
> > that.
> >
> > I was playing around with uuidgen to see if that could be used to
> > generate something unique but it creates too many bits.  I thought
> > it might be interesting to use it to seed a /etc/hostid file, though.
> >
> > Anyway, this would be a good project for anyone interested in contributing
> > something.  It would also remove an XFAIL from the test suite.
> 
> I could probably come up with a patch for this.
> How about using a hash of the following items:
> 1. Processor serial no. (if available)
> 2. MAC address of first ethernet card (if available)
> 3. Windows product id
> 4. Capacity of drive C:
> 5. Anything else lying around.
> 
> There would need to be an option to turn this off however as some privacy
> freaks would probably complain despite the hashing.

What about just returning 0?  According to SUSv3:

"The gethostid() function shall retrieve a 32-bit identifier for the
 current host."

and

"This volume of IEEE Std 1003.1-2001 does not define the domain in which
the return value is unique."

so the domain could be validly restricted to the current host!

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin AT cygwin DOT com
Red Hat, Inc.

- Raw text -


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