From 04ed0407956238f3ab9b2c75ec77c0154f253099 Mon Sep 17 00:00:00 2001 From: Paul Wolneykien Date: Wed, 12 Jul 2017 17:32:32 +0300 Subject: [PATCH 1/2] Add the 'login-unknown' configuration option If the option is set to True, LightDM proceeds to start the new session even if the username is unknown. Tend to be used with pam_mkuser.so PAM module. Signed-off-by: Paul Wolneykien --- src/seat.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/seat.c b/src/seat.c index 85134180c..b399dab74 100644 --- a/src/seat.c +++ b/src/seat.c @@ -998,8 +998,9 @@ create_user_session (Seat *seat, const gchar *username, gboolean autostart) l_debug (seat, "Creating user session"); /* Load user preferences */ + gboolean login_unknown = config_get_boolean (config_get_instance (), "LightDM", "login-unknown"); g_autoptr(User) user = accounts_get_user_by_name (username); - if (!user) + if (!user && !login_unknown) { l_debug (seat, "Can't login unknown user '%s'", username); return NULL; From 7121f1a7e537b9aa5b379adc8f782218ebd4de4d Mon Sep 17 00:00:00 2001 From: Paul Wolneykien Date: Thu, 26 Oct 2017 15:10:29 +0300 Subject: [PATCH 2/2] Lookup 'login-unknown' first in the seat configuration, then in the global section Signed-off-by: Paul Wolneykien --- src/seat.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/seat.c b/src/seat.c index b399dab74..02c0f4d00 100644 --- a/src/seat.c +++ b/src/seat.c @@ -998,7 +998,13 @@ create_user_session (Seat *seat, const gchar *username, gboolean autostart) l_debug (seat, "Creating user session"); /* Load user preferences */ - gboolean login_unknown = config_get_boolean (config_get_instance (), "LightDM", "login-unknown"); + gboolean login_unknown = FALSE; + + if (seat_get_string_property (seat, "login-unknown")) + login_unknown = seat_get_boolean_property (seat, "login-unknown"); + else + login_unknown = config_get_boolean (config_get_instance (), "LightDM", "login-unknown"); + g_autoptr(User) user = accounts_get_user_by_name (username); if (!user && !login_unknown) {