Apple's PAM implementation for Mac OS X is perhaps not the most ideal source of information for PAM on Centos 7.
# yum -y install pam-devel
# rpm -ql pam-devel | grep macro
/usr/include/security/_pam_macros.h
# grep FILE `!!`
grep FILE `rpm -ql pam-devel | grep macro`
* _PAM_LOGFILE must exist and be writable to the programs you debug.
#ifndef _PAM_LOGFILE
#define _PAM_LOGFILE "/var/run/pam-debug.log"
FILE *logfile;
if ((fd = open(_PAM_LOGFILE, O_WRONLY|O_NOFOLLOW|O_APPEND)) != -1) {
if ((fd = open(_PAM_LOGFILE, O_WRONLY|O_APPEND)) != -1) {
FILE *logfile;
if ((fd = open(_PAM_LOGFILE, O_WRONLY|O_NOFOLLOW|O_APPEND)) != -1) {
if ((fd = open(_PAM_LOGFILE, O_WRONLY|O_APPEND)) != -1) {
_pam_output_debug_info(__FILE__, __FUNCTION__, __LINE__); \
Also, PAM must be compiled with the DEBUG
define for any of that code to be reached.