[gnome-initial-setup/wip/pwithnall/misc-fixes: 8/70] um-utils: consider "shared" username to be in use




commit 82b1d4826818b65aedb343b020e2edda56c5f768
Author: Will Thompson <wjt endlessm com>
Date:   Fri Jan 18 06:41:20 2019 +0000

    um-utils: consider "shared" username to be in use
    
    At the point that we generate possible usernames to go with a user's
    full name (and, in our case, silently choose the first one) the "shared"
    user does not yet exist. But if the user enters their full name as
    "shared", we should not generate the username "shared" as a candidate.
    (In this case, the generated username will now be "user" – not ideal,
    but tolerable.)
    
    (The alternative would be to not try to create the normal "shared" user
    in this case, or use a different name. However, username "shared" has
    special handling in GDM on Endless, to clear various bits of state when
    their session begins and ends.)
    
    https://phabricator.endlessm.com/T19500

 gnome-initial-setup/pages/account/um-utils.c | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/gnome-initial-setup/pages/account/um-utils.c b/gnome-initial-setup/pages/account/um-utils.c
index c2567fa9..80c57411 100644
--- a/gnome-initial-setup/pages/account/um-utils.c
+++ b/gnome-initial-setup/pages/account/um-utils.c
@@ -170,6 +170,10 @@ is_username_used (const gchar *username)
                 return FALSE;
         }
 
+        if (strcmp (username, SHARED_ACCOUNT_USERNAME) == 0) {
+                return TRUE;
+        }
+
         pwent = getpwnam (username);
 
         return pwent != NULL;


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