summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/configuration.c13
-rw-r--r--src/lightdm.c3
-rw-r--r--tests/scripts/seatdefaults-still-supported.conf8
3 files changed, 14 insertions, 10 deletions
diff --git a/common/configuration.c b/common/configuration.c
index f456faaf..c150d868 100644
--- a/common/configuration.c
+++ b/common/configuration.c
@@ -53,11 +53,16 @@ config_load_from_file (Configuration *config, const gchar *path, GError **error)
groups = g_key_file_get_groups (key_file, NULL);
for (i = 0; groups[i]; i++)
{
- gchar **keys;
+ gchar **keys, *group;
int j;
- if (strcmp (groups[i], "SeatDefaults") == 0)
+ /* Move keys from deprecated [SeatDefaults] into [Seat:*] */
+ group = groups[i];
+ if (strcmp (group, "SeatDefaults") == 0)
+ {
g_printerr ("Configuration file %s contains a deprecated [SeatDefaults] section, use [Seat:*] instead\n", path);
+ group = "Seat:*";
+ }
keys = g_key_file_get_keys (key_file, groups[i], NULL, error);
if (!keys)
@@ -68,10 +73,10 @@ config_load_from_file (Configuration *config, const gchar *path, GError **error)
gchar *value, *k;
value = g_key_file_get_value (key_file, groups[i], keys[j], NULL);
- g_key_file_set_value (config->priv->key_file, groups[i], keys[j], value);
+ g_key_file_set_value (config->priv->key_file, group, keys[j], value);
g_free (value);
- k = g_strdup_printf ("%s]%s", groups[i], keys[j]);
+ k = g_strdup_printf ("%s]%s", group, keys[j]);
g_hash_table_insert (config->priv->key_sources, k, source_path);
}
diff --git a/src/lightdm.c b/src/lightdm.c
index f2c300f2..8d433492 100644
--- a/src/lightdm.c
+++ b/src/lightdm.c
@@ -153,9 +153,8 @@ get_config_sections (const gchar *seat_name)
gchar **groups, **i;
GList *config_sections = NULL;
- /* Load seat defaults first and support old method of [SeatDefaults] */
+ /* Load seat defaults first */
config_sections = g_list_append (config_sections, g_strdup ("Seat:*"));
- config_sections = g_list_append (config_sections, g_strdup ("SeatDefaults"));
groups = config_get_groups (config_get_instance ());
for (i = groups; *i; i++)
diff --git a/tests/scripts/seatdefaults-still-supported.conf b/tests/scripts/seatdefaults-still-supported.conf
index 9daef83c..d4714e69 100644
--- a/tests/scripts/seatdefaults-still-supported.conf
+++ b/tests/scripts/seatdefaults-still-supported.conf
@@ -1,12 +1,12 @@
#
-# Check LightDM still supports (now deprecated) config section [SeatDefaults] and these options override [Seat:*]
+# Check LightDM still supports (now deprecated) config section [SeatDefaults] and merges these with [Seat:*]
#
-[Seat:*]
-user-session=alternative
-
[SeatDefaults]
autologin-user=have-password1
+user-session=alternative
+
+[Seat:*]
user-session=default
#?*START-DAEMON