[6400] in Kerberos

home help back first fref pref prev next nref lref last post

C_Block is a struct or a pointer?

daemon@ATHENA.MIT.EDU (Thor Lancelot Simon)
Sat Dec 23 11:23:28 1995

To: kerberos@MIT.EDU
Date: 23 Dec 1995 11:05:06 -0500
From: tls@rek.tjls.com (Thor Lancelot Simon)

I've been hacking on an eBones-derived krb4 lately and am on the verge of
tearing my hair out after suddenly realizing why all the prototypes in the
header files didn't match the actual functions.

All the header files had most of the functions taking pointers to struct
des_cblock when they wanted to throw cblock structures around.

Inside the libraries, of course, C_Block is used instead of des_cblock.

The des.h that came as part of the Young libdes that generally is used with
eBones #defines C_Block to des_cblock.

So to get the libraries to compile cleanly, I of course went and fixed all the
"incorrect" prototypes in the header files -- I was fixing a bunch of data
type mistakes anyway, so while I was a bit surprised at the pervasiveness of
the des_cblock vs des_cblock * chaos, I wasn't _too_ surprised.

I then went to make sure the utilities compiled and realized that they didn't
use C_Block, they used des_cblock, and they seemed to assume that the library
functions took des_cblock * where internally they used C_Block.

Of course, all of this nonsense _worked_ if one just ignored the compiler
warnings either when building the libraries or when building the programs --
presumably because GCC passes pointers instead of structures and dynamically
allocates the storage?

I am now about to go reverse the changes I made to the header files and go
fix the libdes I'm using.  Before I do that, I'd like to get confirmation from
someone more familiar with the krb4 internals that C_Block is in fact supposed
to be a pointer to a structure, not the structure itself -- and if I'm wrong,
perhaps a hint as to why all the header files are mistaken!

Is this mistake endemic to all eBones implementations?  Or am I just using an
old or strangely hacked Young libdes?
-- 
Thor Lancelot Simon                                             tls@rek.tjls.com

   Where is the day that melted into one rich noise?          --Thomas Wolfe

home help back first fref pref prev next nref lref last post