diff options
author | Matthias Clasen <mclasen@redhat.com> | 2014-03-04 19:06:36 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2014-03-04 19:06:36 -0500 |
commit | 3f5ec8f74af20a5dbcb627d514a4ac28cff32168 (patch) | |
tree | 652dc2afaad8c0efd1545e0811c8d13e936912f5 | |
parent | ed80c400d15500df30bdfad192b181ffd9b79610 (diff) | |
download | gnome-initial-setup-keyring.tar.gz |
Use a simplified keyring launchkeyring
This depends on gnome-keyring-daemon learning the new --unlock
option, which will hopefully happen soon.
-rw-r--r-- | gnome-initial-setup/gis-keyring.c | 32 |
1 files changed, 3 insertions, 29 deletions
diff --git a/gnome-initial-setup/gis-keyring.c b/gnome-initial-setup/gis-keyring.c index b5cda9c..136bc21 100644 --- a/gnome-initial-setup/gis-keyring.c +++ b/gnome-initial-setup/gis-keyring.c @@ -43,49 +43,23 @@ gis_ensure_login_keyring (const gchar *pwd) GSubprocess *subprocess = NULL; GSubprocessLauncher *launcher = NULL; GError *error = NULL; - gchar *output = NULL; - gchar **env = NULL; g_debug ("launching gnome-keyring-daemon --login"); launcher = g_subprocess_launcher_new (G_SUBPROCESS_FLAGS_STDIN_PIPE | G_SUBPROCESS_FLAGS_STDOUT_PIPE | G_SUBPROCESS_FLAGS_STDERR_SILENCE); - subprocess = g_subprocess_launcher_spawn (launcher, &error, "gnome-keyring-daemon", "--login", NULL); + subprocess = g_subprocess_launcher_spawn (launcher, &error, "gnome-keyring-daemon", "--unlock", NULL); if (subprocess == NULL) { - g_warning ("Failed to spawn gnome-keyring-daemon --login: %s", error->message); + g_warning ("Failed to spawn gnome-keyring-daemon --unlock: %s", error->message); g_error_free (error); goto out; } - if (!g_subprocess_communicate_utf8 (subprocess, "gis", NULL, &output, NULL, &error)) { + if (!g_subprocess_communicate_utf8 (subprocess, "gis", NULL, NULL, NULL, &error)) { g_warning ("Failed to communicate with gnome-keyring-daemon: %s", error->message); g_error_free (error); goto out; } - g_debug ("Read from keyring: %s\n", output); - - env = g_strsplit (output, "\n", 0); - - g_object_unref (launcher); - g_object_unref (subprocess); - - launcher = g_subprocess_launcher_new (G_SUBPROCESS_FLAGS_STDIN_INHERIT | G_SUBPROCESS_FLAGS_STDOUT_SILENCE); - - g_subprocess_launcher_set_environ (launcher, env); - - g_debug ("launching gnome-keyring-daemon --start"); - subprocess = g_subprocess_launcher_spawn (launcher, &error, "gnome-keyring-daemon", "--start", NULL); - - if (subprocess == NULL) { - g_warning ("Failed to spawn gnome-keyring-daemon --start: %s", error->message); - g_error_free (error); - goto out; - } - out: - if (env) - g_strfreev (env); - if (output) - g_free (output); if (subprocess) g_object_unref (subprocess); if (launcher) |