Don't shutdown termbox2 if authentication fails

Signed-off-by: AnErrupTion <anerruption@disroot.org>
This commit is contained in:
AnErrupTion
2025-03-06 15:29:56 +01:00
parent 6cb102257c
commit 9168266cca
2 changed files with 20 additions and 2 deletions

View File

@@ -20,6 +20,7 @@ pub const AuthOptions = struct {
setup_cmd: []const u8,
login_cmd: ?[]const u8,
x_cmd: []const u8,
session_pid: std.posix.pid_t,
};
var xorg_pid: std.posix.pid_t = 0;
@@ -164,6 +165,9 @@ fn startSession(
// Change to the user's home directory
std.posix.chdirZ(pwd.pw_dir.?) catch return error.ChangeDirectoryFailed;
// Signal to the session process to give up control on the TTY
_ = std.posix.kill(options.session_pid, std.posix.SIG.CHLD) catch return error.TtyControlTransferFailed;
// Execute what the user requested
switch (current_environment.display_server) {
.wayland => try executeWaylandCmd(pwd.pw_shell.?, options, current_environment.cmd),