mirror of
https://github.com/systemd/systemd.git
synced 2026-08-04 15:10:33 +00:00
pam_systemd: always set XDG_SESSION_{CLASS|TYPE|DESKTOP}
We likely get the data from the env block, but we might also determine it from elsewhere (such as PAM module parameters). Let's set the env vars on the env block explicitly, so that they are available always, and apps can rely on it.
This commit is contained in:
@@ -553,6 +553,22 @@ _public_ PAM_EXTERN int pam_sm_open_session(
|
||||
return r;
|
||||
}
|
||||
|
||||
/* Most likely we got the session/type/class from environment variables, but might have gotten the data
|
||||
* somewhere else (for example PAM module parameters). Let's now update the environment variables, so that this
|
||||
* data is inherited into the session processes, and programs can rely on them to be initialized. */
|
||||
|
||||
r = update_environment(handle, "XDG_SESSION_TYPE", type);
|
||||
if (r != PAM_SUCCESS)
|
||||
return r;
|
||||
|
||||
r = update_environment(handle, "XDG_SESSION_CLASS", class);
|
||||
if (r != PAM_SUCCESS)
|
||||
return r;
|
||||
|
||||
r = update_environment(handle, "XDG_SESSION_DESKTOP", desktop);
|
||||
if (r != PAM_SUCCESS)
|
||||
return r;
|
||||
|
||||
r = update_environment(handle, "XDG_SEAT", seat);
|
||||
if (r != PAM_SUCCESS)
|
||||
return r;
|
||||
|
||||
Reference in New Issue
Block a user