-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use a separate program to exec qrexec services
This makes executing a program via the shell consistent with doing so _not_ via the shell: both handle the environment the same way, and both produce the same error codes if the program is bad. This also significantly simplifiex exec_qubes_rpc2(), which doesn't need to handle creating a shell command anymore. It is assumed that the user's startup files do not modify the positional parameters outside of a function. Doing so would be extremely buggy and break the R4.2 multiplexer. The new code does use spaces in shell script arguments, but if the user's startup files break when that happens, the user has other problems. This is an ABI break for libqrexec, but that's okay in an unstable release. In the future, libqrexec should really be a static library. Fixes: 8728002 (Stop using qubes-rpc-multiplexer for service calls)
- Loading branch information
Showing
18 changed files
with
104 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include <stdlib.h> | ||
#include <err.h> | ||
#include <libqrexec-utils.h> | ||
int main(int argc, char **argv) | ||
{ | ||
extern char **environ; | ||
if (argc == 5) { | ||
if (setenv("QREXEC_SERVICE_PATH", argv[4], 1)) { | ||
err(QREXEC_EXIT_PROBLEM, "setenv"); | ||
} | ||
} else if (argc == 4) { | ||
if (unsetenv("QREXEC_SERVICE_PATH")) { | ||
err(QREXEC_EXIT_PROBLEM, "setenv"); | ||
} | ||
} else { | ||
errx(QREXEC_EXIT_PROBLEM, "usage: qrexec-run AGENT_PID PROGRAM COMMAND [SERVICE_PATH]"); | ||
} | ||
if (setenv("QREXEC_AGENT_PID", argv[1], 1)) { | ||
err(QREXEC_EXIT_PROBLEM, "setenv"); | ||
} | ||
exec_qubes_rpc2(argv[2], argv[3], environ); | ||
/* does not return */ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
usr/lib/libqrexec-utils.so.5* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
libqrexec-utils 5 libqrexec-utils5 (>4.3.3) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.