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

Re: patch for pam_unix



On Tue, 28 Dec 1999, Nalin Dahyabhai wrote:

> > The correct solution is to malloc() the space for the return value, and pass
> > its address to pam_set_data().  The pam_sm_setcred() function is then
> > responsible for freeing the data when it's done with it.

> I suspected as much, but I'm fairly sure it's safe to store an int in a
> pointer and (knowing that it was an int to start with) to retrieve it
> as well.  Allocating and freeing memory would have added more complexity
> to it than I wanted to.

It's almost always *safe* to store an int in a pointer, but it's not *correct*
to do so. :)  Doing this will cause casting issues and generate compile-time
warnings on 64-bit architectures.

-Steve Langasek
postmodern programmer



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