summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2013-05-20 14:53:22 -0400
committerRay Strode <rstrode@redhat.com>2013-05-20 19:49:12 -0400
commitc155a72d4da6afe5ed6846954e6f06086ea91912 (patch)
treecbdf0376fc093ac16a60183d7e57702962870e5c
parente3bf97a6c42f94f86a9ebc7e7a7ae6d0cd426e41 (diff)
downloadaccountsservice-c155a72d4da6afe5ed6846954e6f06086ea91912.tar.gz
daemon:Trust SystemAccount key from keyfile over heuristics
We use some less than perfect heuristics for determining whether or not a user is a "system account". This commit defers to what's in the key file when the key file explicitly says. https://bugs.freedesktop.org/show_bug.cgi?id=64769
-rw-r--r--src/user.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/user.c b/src/user.c
index af60bb3..726a9d6 100644
--- a/src/user.c
+++ b/src/user.c
@@ -347,6 +347,16 @@ user_update_from_keyfile (User *user,
g_object_notify (G_OBJECT (user), "icon-file");
}
+ if (g_key_file_has_key (keyfile, "User", "SystemAccount", NULL)) {
+ gboolean system_account;
+
+ system_account = g_key_file_get_boolean (keyfile, "User", "SystemAccount", NULL);
+ if (system_account != user->system_account) {
+ user->system_account = system_account;
+ g_object_notify (G_OBJECT (user), "system-account");
+ }
+ }
+
g_object_thaw_notify (G_OBJECT (user));
}