0

According to the D(x) macro defined in pam_macros.h (source code) and used as follows:

D(("Hello PAM World"));

Where is this log located on CentOS7?

Note that I am using as flag debug in my pam.d conf file.

I tried also the following command:

grep -rnw '/var/log/' -e "Hello Pam World"

But with no success.

1

1 Answer 1

1

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.

2
  • Sorry for the stupid question... Which is the proper way to define the flag DEBUG? Has it to be added at compile time?
    – vdenotaris
    Sep 23, 2015 at 21:23
  • Yes, at compile time. The gcc or whatever lines should show a -DDEBUG if you've set it right for the compile. This could either be done in the RPM *.spec file somewhere, or via a manual build via CFLAGS=-DDEBUG ...
    – thrig
    Sep 23, 2015 at 21:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .