Fix wsssht path handling for exec

- Use execl for absolute/relative paths, execvp for PATH search
- Ensures wsssht is found correctly
parent 25b1ce87
......@@ -148,7 +148,12 @@ static int launch_wsssht_daemon(const char *service, const char *client_id, cons
dup2(pipefd[1], STDOUT_FILENO); // Redirect stdout to pipe
close(pipefd[1]); // Close write end after dup
execl(wsssht_path, "wsssht", "--daemon", target, NULL);
if (strchr(wsssht_path, '/')) {
execl(wsssht_path, "wsssht", "--daemon", target, NULL);
} else {
char *argv[] = {"wsssht", "--daemon", target, NULL};
execvp(wsssht_path, argv);
}
perror("[WEB-PROXY] Failed to execl wsssht");
exit(1);
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment