feat: support Xorg & better auth logic (#80)

Co-authored-by: grialion <48643945+grialion@users.noreply.github.com>
This commit is contained in:
2026-01-19 21:17:45 +01:00
committed by GitHub
parent d65bd7a8ee
commit 7e7a297e2e
28 changed files with 842 additions and 351 deletions

View File

@@ -21,15 +21,17 @@ int read_launch_state(struct LaunchState* NNULLABLE state) {
};
size_t num = 0;
if (getline(&state->username, &num, state_fd) < 0) goto fail;
state->username[strcspn(state->username, "\n")] = 0;
ssize_t chars = getline(&state->username, &num, state_fd);
if (chars < 0) goto fail;
if (state->username[chars] == '\n') state->username[chars] = 0;
num = 0;
if (getline(&state->session_opt, &num, state_fd) < 0) {
chars = getline(&state->session_opt, &num, state_fd);
if (chars < 0) {
free(state->session_opt);
goto fail;
}
state->session_opt[strcspn(state->session_opt, "\n")] = 0;
if (state->session_opt[chars] == '\n') state->session_opt[chars] = 0;
(void)fclose(state_fd);
return 0;