
根據(D(x)
pam_macros.h
原始碼)並如下使用:
D(("Hello PAM World"));
該日誌位於哪裡CentOS7
?
debug
請注意,我在我的pam.d
conf 檔案中使用 as 標誌。
我還嘗試了以下命令:
grep -rnw '/var/log/' -e "Hello Pam World"
但沒有成功。
答案1
Apple 針對 Mac OS X 的 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 必須使用要存取的任何程式碼的定義進行編譯。