1
0
Fork 0
mirror of https://github.com/Raymo111/i3lock-color.git synced 2024-11-11 13:50:52 -05:00

fix pam_securetty: set PAM_TTY to getenv("DISPLAY")

fixes #43
This commit is contained in:
Michael Stapelberg 2015-11-05 23:22:08 +01:00
parent 929e541fb7
commit 688d49d5b8

View file

@ -834,8 +834,10 @@ int main(int argc, char *argv[]) {
srand(time(NULL));
/* Initialize PAM */
ret = pam_start("i3lock", username, &conv, &pam_handle);
if (ret != PAM_SUCCESS)
if ((ret = pam_start("i3lock", username, &conv, &pam_handle)) != PAM_SUCCESS)
errx(EXIT_FAILURE, "PAM: %s", pam_strerror(pam_handle, ret));
if ((ret = pam_set_item(pam_handle, PAM_TTY, getenv("DISPLAY"))) != PAM_SUCCESS)
errx(EXIT_FAILURE, "PAM: %s", pam_strerror(pam_handle, ret));
/* Using mlock() as non-super-user seems only possible in Linux. Users of other