PAM 표준 매크로 및 CentOS7의 로깅

PAM 표준 매크로 및 CentOS7의 로깅

( D(x)에 정의된 매크로 에 따르면pam_macros.h소스 코드) 다음과 같이 사용됩니다.

D(("Hello PAM World"));

이 로그는 어디에 있습니까 CentOS7?

내 conf 파일 debug에서 플래그로 사용하고 있습니다 .pam.d

다음 명령도 시도했습니다.

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

그러나 성공하지 못했습니다.

답변1

Mac OS X에 대한 Apple의 PAM 구현은 아마도 Centos 7의 PAM에 대한 가장 이상적인 정보 소스가 아닐 것입니다.

# 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__); \

DEBUG또한 PAM은 해당 코드에 도달하려면 정의를 사용하여 컴파일해야 합니다 .

관련 정보