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

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



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

						- Ted



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