using the uname() function

Ulrich Drepper drepper at redhat.com
Tue Sep 9 23:44:22 UTC 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Fred Bartholomai wrote:

> Using this same function on Red Hat 8.0 the ‘idnumber’ field does not exist.
> 
> Does anyone know of an alternative way of getting such a idnumber ?

This is the job of the gethostid() function which is even in POSIX so
you really shouldn't have looked far.

But the implementation of this function isn't something you will like.
It does not provide a secure mechanism.  The sysadmin is able to change
the information at will.  Well, using the uname() function would have
the same problem.  One would just have to preload a DSO with the
appropriate gethostid/uname/... implementation which returns the right
number.

If you need something which cannot be tempered with you need to install
extra hardware like a dongle.

- -- 
- --------------.                        ,-.            444 Castro Street
Ulrich Drepper \    ,-----------------'   \ Mountain View, CA 94041 USA
Red Hat         `--' drepper at redhat.com `---------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE/XmXW2ijCOnn/RHQRAmM6AKCUBWqjQfqd76IyVKwJV2YfHeGN/ACePLp+
fL6v9CRHImRXRHUccUR6sqc=
=Jm1X
-----END PGP SIGNATURE-----





More information about the fedora-devel-list mailing list