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

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



Theodore Y. Ts'o writes:
>    From: Andrew Morgan <morgan@transmeta.com>
> 	   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 );
> 
> I'd suggest using a void * for the handle, instead of an int.  Working

Before proceeding with this.  I'd like to propose that we consider an
alternative to mimicing the old API.  One of the standard problems
with this sort of API is that we use multiple functions to implement
an inherently atomic request (append "this" to the log).  In other
words, by design, we are writing code that is fraught with races
(especially in multi threaded apps).

Would it be objectionable to implement logging with a single
function?:

   pam_system_log(const char *ident, int option, int facility,
		  int priority, const char *format, ...);

> 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.  :-)

What do people think?

Cheers

Andrew



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