Log error and exit if swaylock is suid with PAM backend.

This commit is contained in:
Connor E 2019-01-18 12:56:00 +00:00
parent af03502384
commit ccefa54bb7

5
pam.c
View File

@ -12,6 +12,11 @@
static char *pw_buf = NULL; static char *pw_buf = NULL;
void initialize_pw_backend(void) { void initialize_pw_backend(void) {
if (getuid() != geteuid() || getgid() != getegid()) {
swaylock_log(LOG_ERROR,
"swaylock has suid but doesn't require it with PAM backend");
exit(EXIT_FAILURE);
}
if (!spawn_comm_child()) { if (!spawn_comm_child()) {
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }