summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pam/gkr-pam-module.c8
-rw-r--r--pam/test-pam.c9
2 files changed, 16 insertions, 1 deletions
diff --git a/pam/gkr-pam-module.c b/pam/gkr-pam-module.c
index c06d8321..35927318 100644
--- a/pam/gkr-pam-module.c
+++ b/pam/gkr-pam-module.c
@@ -348,6 +348,7 @@ setup_child (int inp[2],
const char *argument)
{
const char* display;
+ const char *runtime;
int i, ret;
char *args[] = {
@@ -404,7 +405,12 @@ setup_child (int inp[2],
if (display)
ret = setup_pam_env (ph, "DISPLAY", display);
}
-
+ if (ret == PAM_SUCCESS && !pam_getenv (ph, "XDG_RUNTIME_DIR")) {
+ runtime = getenv ("XDG_RUNTIME_DIR");
+ if (runtime)
+ ret = setup_pam_env (ph, "XDG_RUNTIME_DIR", runtime);
+ }
+
/* Make sure that worked */
if (ret != PAM_SUCCESS) {
syslog (GKR_LOG_ERR, "gkr-pam: couldn't setup environment: %s",
diff --git a/pam/test-pam.c b/pam/test-pam.c
index 56eebcae..55f49ac6 100644
--- a/pam/test-pam.c
+++ b/pam/test-pam.c
@@ -278,6 +278,9 @@ test_starts_creates (Test *test,
if (test->skipping)
return;
+ /* We're testing that we create the directory appropriately */
+ g_unsetenv ("XDG_RUNTIME_DIR");
+
start_in_session = (strstr (pam_conf, "session") != NULL);
login_keyring = g_build_filename (test->directory, "login.keyring", NULL);
@@ -322,6 +325,9 @@ test_starts_only_session (Test *test,
/* This is the PAM config that starts the daemon from session handler */
g_assert (strstr (pam_conf, "session-start") != NULL);
+ /* We're testing that we create the directory appropriately */
+ g_unsetenv ("XDG_RUNTIME_DIR");
+
login_keyring = g_build_filename (test->directory, "login.keyring", NULL);
g_assert (!g_file_test (login_keyring, G_FILE_TEST_EXISTS));
@@ -345,6 +351,9 @@ test_starts_exists (Test *test,
if (test->skipping)
return;
+ /* We're testing that we create the directory appropriately */
+ g_unsetenv ("XDG_RUNTIME_DIR");
+
start_in_session = (strstr (pam_conf, "session") != NULL);
egg_tests_copy_scratch_file (test->directory, SRCDIR "/pam/fixtures/login.keyring");