mirror of https://github.com/fairyglade/ly.git
fix logging out
This commit is contained in:
parent
0aa400383a
commit
f02d3e2db2
|
@ -169,11 +169,7 @@ pub fn authenticate(allocator: Allocator, config: Config, desktop: Desktop, logi
|
|||
addUtmpEntry(&entry, pwd.pw_name, pid) catch {};
|
||||
|
||||
// Wait for the session to stop
|
||||
const ch_proc = std.os.waitpid(pid, 0);
|
||||
|
||||
var err = shared_err.readError();
|
||||
if (ch_proc.status != 0 and err == null)
|
||||
err = error.UnknownError;
|
||||
_ = std.os.waitpid(pid, 0);
|
||||
|
||||
removeUtmpEntry(&entry);
|
||||
|
||||
|
@ -189,8 +185,7 @@ pub fn authenticate(allocator: Allocator, config: Config, desktop: Desktop, logi
|
|||
status = interop.pam.pam_end(handle, status);
|
||||
if (status != 0) return pamDiagnose(status);
|
||||
|
||||
if (err != null)
|
||||
return err.?;
|
||||
if (shared_err.readError()) |err| return err;
|
||||
}
|
||||
|
||||
fn initEnv(allocator: Allocator, pwd: *interop.passwd, path: ?[]const u8) !void {
|
||||
|
|
|
@ -543,7 +543,7 @@ pub fn main() !void {
|
|||
auth_fails += 1;
|
||||
active_input = .password;
|
||||
info_line = getAuthErrorMsg(err, lang);
|
||||
if (config.clear_password) password.clear();
|
||||
if (config.clear_password or err != error.PamAuthError) password.clear();
|
||||
} else {
|
||||
password.clear();
|
||||
info_line = lang.logout;
|
||||
|
|
Loading…
Reference in New Issue