summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRobert Ancell <robert.ancell@canonical.com>2019-09-04 12:25:59 +1200
committerRobert Ancell <robert.ancell@canonical.com>2019-09-04 12:25:59 +1200
commit4b3fdd19588e429867c1305a9cdfd26e991f7f07 (patch)
treedf99fc31cfcd0d9c6bd88cc75a8ae760bd4fd43d /src
parent6aa3ad8d65c8e97a720aed2b84a200407b27ff1e (diff)
daemon: Write GDM custom.conf file if it doesn't exist
The previous code would abort the write if it didn't exist.
Diffstat (limited to 'src')
-rw-r--r--src/daemon.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/daemon.c b/src/daemon.c
index d7c4437..27790e5 100644
--- a/src/daemon.c
+++ b/src/daemon.c
@@ -1522,13 +1522,18 @@ save_autologin (Daemon *daemon,
g_autoptr(GKeyFile) keyfile = NULL;
g_autofree gchar *data = NULL;
gboolean result;
+ g_autoptr(GError) local_error = NULL;
keyfile = g_key_file_new ();
if (!g_key_file_load_from_file (keyfile,
PATH_GDM_CUSTOM,
G_KEY_FILE_KEEP_COMMENTS,
error)) {
- return FALSE;
+ /* It's OK for custom.conf to not exist, we will make it */
+ if (!g_error_matches (local_error, G_FILE_ERROR, G_FILE_ERROR_NOENT)) {
+ g_propagate_error (error, g_steal_pointer (&local_error));
+ return FALSE;
+ }
}
g_key_file_set_string (keyfile, "daemon", "AutomaticLoginEnable", enabled ? "True" : "False");