rshd.c 源代码中缺少 pam_appl.h 和 pam_misc.h

问题描述 投票:0回答:4

我正在开发 centOS 5.5 操作系统

显示 /security/pam_appl.h 和 /security/misc.h 文件丢失的错误。

实际上我的 rshd.c 没有加载 PAM 模块,可能是通过放置这个库,它可以帮助我很好地工作我的 rshd。这就是我发布这个问题的原因。

错误:-

rshd.c:90:31: error: security/pam_appl.h: No such file or directory
rshd.c:91:31: error: security/pam_misc.h: No such file or directory

我搜索了很多,但没有得到任何有用的 rpm 来提供这些文件。

一些链接位于此处。但不适合centOS。

帮助我。告诉我如何克服这个问题。

编辑1

您的第三个链接似乎很有用。当我尝试安装 pam-devel 时,它显示一些错误。

当我跑步时

./configure --prefix=/usr \
            --sysconfdir=/etc \
            --docdir=/usr/share/doc/Linux-PAM-1.1.6 \
            --disable-nis &&
make

它检查一些变量,然后创建目标文件,但最后它显示,

make[3]: *** [pam_xauth.lo] Error 1
make[3]: Leaving directory `~/Linux-PAM-1.1.6/modules/pam_xauth'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `~/Linux-PAM-1.1.6/modules'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `~/Linux-PAM-1.1.6'
make: *** [all] Error 2

编辑2号

当我按照你的命令操作时,它在最后向我显示了以下错误。

当我运行

make && make install

时出现此错误
pam_xauth.c:64:27: error: selinux/label.h: No such file or directory
pam_xauth.c: In function âpam_sm_open_sessionâ:
pam_xauth.c:616: error: âSELABEL_CTX_FILEâ undeclared (first use in this function)
pam_xauth.c:616: error: (Each undeclared identifier is reported only once
pam_xauth.c:616: error: for each function it appears in.)
pam_xauth.c:616: warning: initialization makes pointer from integer without a cast
make[3]: *** [pam_xauth.lo] Error 1
make[3]: Leaving directory `/root/Linux-PAM-1.1.6/modules/pam_xauth'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/root/Linux-PAM-1.1.6/modules'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/Linux-PAM-1.1.6'
make: *** [all] Error 2
c linux centos pam rsh
4个回答
23
投票

如果有人正在寻找 debian/ubuntu,请尝试这个

sudo apt-get install libpam0g-dev


20
投票

我目前没有 CentOS,但这似乎是一个常见问题。请参阅here了解信息,建议您安装 pam-devel,这样您就不必通过以下方式从源代码构建:

yum install pam-devel

似乎每次我找到一个站点,其问题与你的相同时,解决方法就是安装它。我现在正在下载 CentOS 5.5 来尝试一下,但是您刚刚尝试运行该命令吗?

如果您确实安装了它,但仍然找不到头文件,我会尝试一下:

cd /
sudo find . -name "pam_appl.h"
sudo find . -name "pam_misc.h"

它们可能已安装但没有进入您的标准包含路径,或者没有进入

security/
目录,在这种情况下,您需要移动它们或更改标头包含在其中的方式你的代码。

注意对于

sudo
命令,您必须输入密码。


3
投票

您需要 pam-devel 的 rpm,适用于 CentOS 此处。或者,您可以从此处下载 pam 并在本地安装。

编辑: 要编译它,这在我的系统上运行良好:

wget http://linux-pam.org/library/Linux-PAM-1.1.6.tar.bz2
tar xvjf Linux-PAM-1.1.6.tar.bz2
cd Linux-PAM-1.1.6/
./configure --prefix=$HOME/local
make && make install

如果没有,请报告编译器错误。


1
投票

对于通过搜索引擎找到此内容的人,以下内容在 CentOS 7 上对我有用:

yum install pam-devel
© www.soinside.com 2019 - 2024. All rights reserved.