forked from gplll/nss_securepass
-
Notifications
You must be signed in to change notification settings - Fork 1
/
pam_sp.h
34 lines (28 loc) · 1.01 KB
/
pam_sp.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
* File: pam_sp.h
* Author: gplll <gplll1818@gmail.com>, Aug 2015
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is derivative work of pam_radius.c code,
* taken from https://github.com/FreeRADIUS/pam_radius
*/
typedef struct sp_conf_t {
int debug;
int debug_stderr;
} sp_conf_t;
#define PAM_DEBUG 1
#define PAM_DEBUG_STDERR 2
#define error(fmt, args...) \
syslog(LOG_AUTHPRIV|LOG_ERR, "pam_sp: thread %u - error: " fmt, (uint)pthread_self() , ## args); \
#define debug(level, fmt, args...) \
if ((config.debug)) { \
syslog(LOG_AUTHPRIV|LOG_DEBUG, "pam_sp: thread %u - " fmt, (uint)pthread_self() , ## args); \
} \
else if ((config.debug_stderr)) { \
fprintf(stderr, "pam_sp: " fmt "\n" , ## args); \
}
#define _pam_forget(X) if (X) {memset(X, 0, strlen(X));free(X);X = NULL;}