qrexec: exit with code 126 when service request was refused

Exit code 1 is very common in all kind of programs, including qrexec
services, so it is hard to distinguish remote failure from service call
refusal. Use something from top of the range here (but not 127, as it is
commonly used to report "Command not found")

QubesOS/qubes-issues#2861
This commit is contained in:
Marek Marczykowski-Górecki 2017-06-20 23:41:12 +02:00
parent ff26dcfe53
commit d2aa21625c
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -109,7 +109,7 @@ int main(int argc, char **argv)
ret = read(trigger_fd, &exec_params, sizeof(exec_params));
if (ret == 0) {
fprintf(stderr, "Request refused\n");
exit(1);
exit(126);
}
if (ret < 0 || ret != sizeof(exec_params)) {
perror("read");