ProcursusTeam / Procursus

Modern *OS Bootstrap
https://apt.procurs.us
BSD Zero Clause License
873 stars 128 forks source link

PAM stuff might not working as expected #1122

Closed Torrekie closed 2 years ago

Torrekie commented 2 years ago

I have compiled a su from shell-cmds, and it cannot call pam_start

iPhone:/ root# su
su: pam_start: System error

After checking the console log, I found this one

in openpam_load_module(): no pam_rootok.so found

But I'm sure that there is a pam_rootok.so lying in /usr/lib/pam, after checking openpam's source code, I found this part might be a bug

iPhone:/openpam-20190224/lib/libpam root# cat openpam_constants.c
...
const char *openpam_module_path[] = {
#ifdef OPENPAM_MODULES_DIRECTORY
        OPENPAM_MODULES_DIRECTORY,
#else
        "/usr/lib",
        "/usr/local/lib",
#endif
        NULL
};

there was no OPENPAM_MODULES_DIRECTORY defined entire time, causing modules in /usr/lib/pam not being searched by libpam. In fact there is a macro OPENPAM_MODULES_DIR refers to modules directory which defined in config.h, changing OPENPAM_MODULES_DIRECTORY to OPENPAM_MODULES_DIR can fix that problem.

CRKatri commented 2 years ago

OPENPAM_MODULES_DIRECTORY gets replaced by OPENPAM_MODULES_DIR in the patch softcode_paths.patch. Did you build the openpam manually, instead of with Procursus?

Torrekie commented 2 years ago

oh, I didn't check the updates, this patch was not included when I clone this repo few months ago, my bad