From 7098d4999d035b4bc47f714711c7e6f0c9aabc01 Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Tue, 22 Oct 2013 19:59:14 +0300 Subject: [PATCH 2/2] Only warn about a missing username for existing users. --- src/libaccountsservice/act-user-manager.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/libaccountsservice/act-user-manager.c b/src/libaccountsservice/act-user-manager.c index a4288e3..888070d 100644 --- a/src/libaccountsservice/act-user-manager.c +++ b/src/libaccountsservice/act-user-manager.c @@ -998,19 +998,21 @@ on_new_user_loaded (ActUser *user, username = act_user_get_user_name (user); if (username == NULL) { - const char *object_path; + if (!act_user_is_nonexistent (user)) { + const char *object_path; - object_path = act_user_get_object_path (user); + object_path = act_user_get_object_path (user); - if (object_path != NULL) { - g_warning ("ActUserManager: %s has no username " - "(object path: %s, uid: %d)", - describe_user (user), - object_path, (int) act_user_get_uid (user)); - } else { - g_warning ("ActUserManager: %s has no username (uid: %d)", - describe_user (user), - (int) act_user_get_uid (user)); + if (object_path != NULL) { + g_warning ("ActUserManager: %s has no username " + "(object path: %s, uid: %d)", + describe_user (user), + object_path, (int) act_user_get_uid (user)); + } else { + g_warning ("ActUserManager: %s has no username (uid: %d)", + describe_user (user), + (int) act_user_get_uid (user)); + } } g_object_unref (user); goto out; -- 1.8.3.1