如何开发自己的pam 模块:
1、首先要编写.c文件,封装进入pam库
touch my_syz.c
vim my_syz.c
下边为.c文件的内容
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <curl/curl.h>
#include <security/pam_appl.h>
#include <security/pam_modules.h>
/* expected hook */
PAM_EXTERN int pam_sm_setcred( pam_handle_t *pamh, int flags, int argc, const char **argv ) {
return PAM_SUCCESS ;
}
/* this function is ripped from pam_unix/support.c, it lets us do IO via PAM */
int converse( pam_handle_t *pamh, int nargs, struct pam_message **message, struct pam_response **response ) {
int retval ;
struct pam_conv *conv ;
retval = pam_get_item( pamh, PAM_CONV, (const void **) &conv ) ;
if( retval==PAM_SUCCESS ) {
retval = conv->conv( nargs, (const struct pam_message **) message, response, conv-&g