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

Re: Linux-PAM and syslog (POSIX) (fwd)



I'm completely agreed with the both points.

The old syslog interface isn't thread safe, isn't library safe
and isn't whatever safe.

Library functions must avoid to save their state in a static memory.
Andrew, I think the new syslog interface (with handle be void *)
is a Good Thing (tm) and after testing we should propose to add
the code to libc (at least Linux one).

Cheers

Andrey

On Fri, Mar 27, 1998 at 02:23:11AM -0500, Theodore Y. Ts'o wrote:
>    Date: Thu, 26 Mar 1998 21:47:46 -0800
>    From: Andrew Morgan <morgan@transmeta.com>
> 
>    I think what is needed is:
> 
> 	   int pam_misc_openlog( int handle, char *ident, int option, int
> 				   facility); 
> 	   void pam_misc_syslog( int handle, int priority, char *format,
> 				   ...);
> 	   void pam_misc_closelog( int handle );
> 
>    In keeping with POSIX it will be legitimate to call pam_misc_syslog(
>    int handle, int priority, char *format,...); with a handle value of 0,
>    even in cases where you have not called ...openlog first.
> 
> I'd suggest using a void * for the handle, instead of an int.  Working
> on the general principal which says that static variables are bad and
> should be avoided when possible, and fixed length arrays (for which
> integer handles are typically used as array indexes) are a poor idea, by
> using a void *, we can let openlog allocate memory and put all of its
> state in the allocated memory.
> 
> Also, it might be worth considering whether this interface has a general
> applicability beyond pam, in the long term.  It would be very
> interesting if we could get other free OS's, and professional Unix
> systems for that matter, accepting the new API and integrating it into
> their libc's.  :-)



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