mirror of https://github.com/fairyglade/ly.git
Backport: Fix XDG_RUNTIME_DIR not being set properly
Signed-off-by: AnErrupTion <anerruption@disroot.org>
This commit is contained in:
parent
f983c6b19b
commit
170e523823
|
@ -96,7 +96,7 @@ pub fn authenticate(options: AuthOptions, current_environment: Environment, logi
|
||||||
|
|
||||||
child_pid = try std.posix.fork();
|
child_pid = try std.posix.fork();
|
||||||
if (child_pid == 0) {
|
if (child_pid == 0) {
|
||||||
startSession(options, pwd, handle, current_environment) catch |e| {
|
startSession(options, tty_str, pwd, handle, current_environment) catch |e| {
|
||||||
shared_err.writeError(e);
|
shared_err.writeError(e);
|
||||||
std.process.exit(1);
|
std.process.exit(1);
|
||||||
};
|
};
|
||||||
|
@ -132,6 +132,7 @@ pub fn authenticate(options: AuthOptions, current_environment: Environment, logi
|
||||||
|
|
||||||
fn startSession(
|
fn startSession(
|
||||||
options: AuthOptions,
|
options: AuthOptions,
|
||||||
|
tty_str: [:0]u8,
|
||||||
pwd: *interop.pwd.passwd,
|
pwd: *interop.pwd.passwd,
|
||||||
handle: ?*interop.pam.pam_handle,
|
handle: ?*interop.pam.pam_handle,
|
||||||
current_environment: Environment,
|
current_environment: Environment,
|
||||||
|
@ -155,6 +156,10 @@ fn startSession(
|
||||||
// Set up the environment
|
// Set up the environment
|
||||||
try initEnv(pwd, options.path);
|
try initEnv(pwd, options.path);
|
||||||
|
|
||||||
|
// Reset the XDG environment variables
|
||||||
|
setXdgSessionEnv(current_environment.display_server);
|
||||||
|
try setXdgEnv(tty_str, current_environment.xdg_session_desktop, current_environment.xdg_desktop_names);
|
||||||
|
|
||||||
// Set the PAM variables
|
// Set the PAM variables
|
||||||
const pam_env_vars: ?[*:null]?[*:0]u8 = interop.pam.pam_getenvlist(handle);
|
const pam_env_vars: ?[*:null]?[*:0]u8 = interop.pam.pam_getenvlist(handle);
|
||||||
if (pam_env_vars == null) return error.GetEnvListFailed;
|
if (pam_env_vars == null) return error.GetEnvListFailed;
|
||||||
|
|
Loading…
Reference in New Issue