[4443] in Kerberos
Re: what's all the magic for
daemon@ATHENA.MIT.EDU (Theodore Ts'o)
Fri Jan 6 00:14:59 1995
Date: Thu, 5 Jan 1995 21:56:10 +0500
From: Theodore Ts'o <tytso@MIT.EDU>
To: Jim_Miller@suite.com
Cc: kerberos@MIT.EDU
In-Reply-To: Jim Miller's message of Wed, 28 Dec 94 14:18:47 -0600,
<9412282019.AA15918@bilbo.suite.com>
From: jim@bilbo.suite.com (Jim Miller)
Date: Wed, 28 Dec 94 14:18:47 -0600
I recently downloaded the krb5-B4-3 source and have been looking through
it to see what has changed since krb5 beta3. I notice that most of the
important data structures now have a field called "magic" at the beginning
of the structure definition. A quick grep through the source doesn't show
any place where this new field is used. Are the "magic" fields just there
for alignment purposes?
The "magic" fields are for structure magic numbers. Each structure has
its own magic number, which is assigned in the kv5m error table.
The magic number must be initialized in the structure when it is
allocated, and then the krb5 library will check to make sure that magic
number is correct; if it is not, it will return the corresponding error
defined by the kv5m error table. This is provides a small amount of
additional type-safety.
Obviously, this is not fully implemented yet. We'll be gradually adding
in more and more checking for the magic number.
- Ted