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

Re: logging from PAM modules



On Thu, 31 Aug 2000, Michael Tokarev wrote:

> 
> Ok, prototype summary:
> 
>   int pam_log(pam_handle_t *pamh, int priority, const char *fmt, ...);
>   int pam_vlog(pam_handle_t *pamh, int priority, const char *fmt, va_list args);
> 
> That are two public routines used by modules.
> Another one:
> 
>    typedef int pam_log_callback_t
>      (pam_handle_t *pamh, const char *module, const char *service,
>       int priority, const char *message);
>    /* used only to simplify next declaration */
>    pam_log_callback_t *pam_set_log_callback(pam_handle_t *pamh,
>                                             pam_log_callback_t *newcb);
> 
> This routine should be used by application if desirable.
> It returns previuos callback used.  If newcb == NULL, default
> callback will be set.  [Maybe: if pamh == NULL, just return default
> callback and ignore newcb.]
> 

PAM already supports setting two user-defined callback functions:
conversation function and fail-delay function. And there is a
standard convention how to set and retreive them:
 
	pam_(set|get)_item(pamh, PAM_CONV, conv_func);
	pam_(set|get)_item(pamh, PAM_FAIL_DELAY, fail_delay_func);

So, I think we should stick with this principle and use

    pam_set_item(pamh, PAM_LOG_CALLBACK, newcb);
    pam_get_item(pamh, PAM_LOG_CALLBACK, &newcb);

instead of introducting new function which does exatcly the same like:

>    pam_log_callback_t *pam_set_log_callback(pam_handle_t *pamh,
>                                             pam_log_callback_t *newcb);
>       

Regards,
NP

-- 
                                   "GNU/Linux - A Free OS for Free People"
__________________________________________________________________________






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