Skip to content

Commit

Permalink
openrc-pam: create ${XDG_RUNTIME_DIR}/openrc when the var is already set
Browse files Browse the repository at this point in the history
Signed-off-by: Anna (navi) Figueiredo Gomes <[email protected]>
  • Loading branch information
navi-desu committed Jun 23, 2023
1 parent 7870d59 commit ecaf2f0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/openrc-pam/openrc-pam.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,9 @@ static bool exec_openrc(pam_handle_t *pamh, const char *runlevel, bool lock) {
elog(LOG_INFO, "exporting: %s", xdg_runtime_dir_env);
free(xdg_runtime_dir);
free(xdg_runtime_dir_env);
} else {
xasprintf(&xdg_runtime_dir, "%s/%s", pam_getenv(pamh, "XDG_RUNTIME_DIR"), "openrc");
mkdir(xdg_runtime_dir, 0700);
}

envlist = pam_getenvlist(pamh);
Expand Down

0 comments on commit ecaf2f0

Please sign in to comment.