[gnome-initial-setup] only create keyring manually for new user mode



commit 59dfa4fef1a5e45911d802817d303a874216b3cb
Author: Tristan Van Berkom <tristan vanberkom codethink co uk>
Date:   Tue Nov 24 10:54:55 2015 +0000

    only create keyring manually for new user mode
    
    gnome-initial-setup has code to create a login keyring.  This is used
    the first boot after an install as a staging area for account passwords
    set up during gnome-initial-setup.
    
    If gnome-initial-setup is run at login time instead of at boot time (if
    it gets run on an existing user, instead of getting run to create a new
    user), then there is no need to create the login keyring.  It will have
    already been created when the user first logged in.
    
    This commit avoids touching the keyring in that case.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=758592

 gnome-initial-setup/gnome-initial-setup.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/gnome-initial-setup/gnome-initial-setup.c b/gnome-initial-setup/gnome-initial-setup.c
index ce9b679..57284ba 100644
--- a/gnome-initial-setup/gnome-initial-setup.c
+++ b/gnome-initial-setup/gnome-initial-setup.c
@@ -190,6 +190,7 @@ main (int argc, char *argv[])
   GisDriver *driver;
   int status;
   GOptionContext *context;
+  GisDriverMode mode;
 
   GOptionEntry entries[] = {
     { "existing-user", 0, 0, G_OPTION_ARG_NONE, &force_existing_user_mode,
@@ -221,9 +222,17 @@ main (int argc, char *argv[])
   }
 #endif
 
-  gis_ensure_login_keyring ();
+  mode = get_mode ();
 
-  driver = gis_driver_new (get_mode ());
+  /* When we are running as the gnome-initial-setup user we
+   * dont have a normal user session and need to initialize
+   * the keyring manually so that we can pass the credentials
+   * along to the new user in the handoff.
+   */
+  if (mode == GIS_DRIVER_MODE_NEW_USER)
+    gis_ensure_login_keyring ();
+
+  driver = gis_driver_new (mode);
   g_signal_connect (driver, "rebuild-pages", G_CALLBACK (rebuild_pages_cb), NULL);
   status = g_application_run (G_APPLICATION (driver), argc, argv);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]