[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: 2nd call: binary incompatibility



On Wed, 17 Sep 1997, Theodore Y. Ts'o wrote:

> a pointer to a PAM handle, we can process it as if it were an new-style
> function.  I'd advocate putting a magic number into the PAM structure,
> to make it easier to tell whether or not we're pointing at a valid PAM
> structure.

And how would you test that out ? If you do:
	if (firstarg->magic == magicnumber)
		blah;
you already have a race. How do you de-reference a pointer which might not
be a pointer ?

On the same track, I suggest having the new pam_strerror function able to
loop through a list of assigned pamh and compare the first arg to each of
those. That means that will work in most cases, provided that the
application is not fooling around with *pamh and copying it to a
local-alloced structure, etc...

It's hard to tell wether the first arg is a *pamh after 'if it's not a
small number', because on some platforms byte ordering can cause some
problems...

Better off cut from the early stage than try to maintain a workaround that
will be broken at some point in the near future...

Cristian
--
----------------------------------------------------------------------
Cristian Gafton   --   gafton@redhat.com   --   Red Hat Software, Inc.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 UNIX is user friendly. It's just selective about who its friends are.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []