Skip to content

Commit 890a4eb

Browse files
committed
pam_openrc: avoid clobbering errno when checking for rc_autostart_user
1 parent 85214ae commit 890a4eb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/pam_openrc/pam_openrc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
static int
1616
exec_openrc(pam_handle_t *pamh, bool opening, bool quiet)
1717
{
18+
char *do_autostart = rc_conf_value("rc_autostart_user");
1819
char *svc_name, *pam_lock, *logins, *script = NULL;
1920
const char *username = NULL, *session = NULL;
2021
RC_SERVICE service_status;
@@ -24,7 +25,7 @@ exec_openrc(pam_handle_t *pamh, bool opening, bool quiet)
2425
pid_t pid = -1;
2526

2627
errno = 0;
27-
if (!rc_yesno(rc_conf_value("rc_autostart_user")) && errno == 0)
28+
if (!rc_yesno(do_autostart) && errno == 0)
2829
return PAM_SUCCESS;
2930

3031
setenv("EINFO_LOG", "pam_openrc", true);

0 commit comments

Comments
 (0)