From: Lennart Poettering Date: Mon, 27 Nov 2023 17:36:06 +0000 (+0100) Subject: logind: add new 'user-incomplete' session class X-Git-Tag: v256-rc1~862^2~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=53ebde6db44418da7b537407367de5f1aa120f60;p=thirdparty%2Fsystemd.git logind: add new 'user-incomplete' session class --- diff --git a/man/pam_systemd.xml b/man/pam_systemd.xml index 1a841df13bf..dcd104907a5 100644 --- a/man/pam_systemd.xml +++ b/man/pam_systemd.xml @@ -115,6 +115,10 @@ user-early Similar to user but sessions of this class are not ordered after systemd-user-sessions.service, i.e. may be started before regular sessions are allowed to be established. This session class is the default for sessions of the root user that would otherwise qualify for the user class, see above. (Added in v256.) + + user-incomplete + Similar to user but for sessions which are not fully set up yet, i.e. have no home directory mounted ot similar. This is used by systemd-homed.service8 to allow users to log in via ssh before their home directory is mounted, delaying the mount until the user provided the unlock password. Sessions of this class are upgraded to the regular user class once the home directory is activated. + greeter Similar to user but for sessions that are spawned by a display manager ephemerally and which prompt the user for login credentials. diff --git a/man/sd_session_is_active.xml b/man/sd_session_is_active.xml index 747fab4c68f..1cbef64e003 100644 --- a/man/sd_session_is_active.xml +++ b/man/sd_session_is_active.xml @@ -216,9 +216,10 @@ sd_session_get_class() may be used to determine the class of the session identified by the specified session identifier. The returned string is one of user, - user-early, greeter, lock-screen, - background, background-light, manager or - manager-early and needs to be freed with the libc user-early, user-incomplete, greeter, + lock-screen, background, background-light, + manager or manager-early and needs to be freed with the libc + free3 call after use. diff --git a/src/login/logind-session.c b/src/login/logind-session.c index 69dc52ad66c..ffdd42002ae 100644 --- a/src/login/logind-session.c +++ b/src/login/logind-session.c @@ -1648,6 +1648,7 @@ DEFINE_STRING_TABLE_LOOKUP(session_type, SessionType); static const char* const session_class_table[_SESSION_CLASS_MAX] = { [SESSION_USER] = "user", [SESSION_USER_EARLY] = "user-early", + [SESSION_USER_INCOMPLETE] = "user-incomplete", [SESSION_GREETER] = "greeter", [SESSION_LOCK_SCREEN] = "lock-screen", [SESSION_BACKGROUND] = "background", diff --git a/src/login/logind-session.h b/src/login/logind-session.h index 6a0fb543035..34cf9b075bc 100644 --- a/src/login/logind-session.h +++ b/src/login/logind-session.h @@ -22,6 +22,7 @@ typedef enum SessionState { typedef enum SessionClass { SESSION_USER, /* A regular user session */ SESSION_USER_EARLY, /* A user session, that is not ordered after systemd-user-sessions.service (i.e. for root) */ + SESSION_USER_INCOMPLETE, /* A user session that is only half-way set up and doesn't pull in the service manager, and can be upgraded to a full user session later */ SESSION_GREETER, /* A login greeter pseudo-session */ SESSION_LOCK_SCREEN, /* A lock screen */ SESSION_BACKGROUND, /* Things like cron jobs, which are non-interactive */ @@ -37,7 +38,7 @@ typedef enum SessionClass { #define SESSION_CLASS_IS_EARLY(class) IN_SET((class), SESSION_USER_EARLY, SESSION_MANAGER_EARLY) /* Which session classes want their own scope units? (all of them, except the manager, which comes in its own service unit already */ -#define SESSION_CLASS_WANTS_SCOPE(class) IN_SET((class), SESSION_USER, SESSION_USER_EARLY, SESSION_GREETER, SESSION_LOCK_SCREEN, SESSION_BACKGROUND, SESSION_BACKGROUND_LIGHT) +#define SESSION_CLASS_WANTS_SCOPE(class) IN_SET((class), SESSION_USER, SESSION_USER_EARLY, SESSION_USER_INCOMPLETE, SESSION_GREETER, SESSION_LOCK_SCREEN, SESSION_BACKGROUND, SESSION_BACKGROUND_LIGHT) /* Which session classes want their own per-user service manager? */ #define SESSION_CLASS_WANTS_SERVICE_MANAGER(class) IN_SET((class), SESSION_USER, SESSION_USER_EARLY, SESSION_GREETER, SESSION_LOCK_SCREEN, SESSION_BACKGROUND)