mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-11 05:17:44 +03:00
cgroups-agent: connect stdin/stdout/stderr to /dev/null
Inspired by https://github.com/systemd/systemd/pull/24024 this is another user mode helper, where this might be an issue. hence let's rather be safe than sorry, and also connect stdin/stdout/stderr explicitly with /dev/null.
This commit is contained in:
parent
81b739d258
commit
50492ce815
@ -16,6 +16,13 @@ int main(int argc, char *argv[]) {
|
|||||||
_cleanup_close_ int fd = -1;
|
_cleanup_close_ int fd = -1;
|
||||||
ssize_t n;
|
ssize_t n;
|
||||||
size_t l;
|
size_t l;
|
||||||
|
int r;
|
||||||
|
|
||||||
|
r = rearrange_stdio(-1, -1, -1);
|
||||||
|
if (r < 0) {
|
||||||
|
log_error_errno(r, "Failed to connect stdin/stdout/stderr with /dev/null: %m");
|
||||||
|
return EXIT_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
if (argc != 2) {
|
if (argc != 2) {
|
||||||
log_error("Incorrect number of arguments.");
|
log_error("Incorrect number of arguments.");
|
||||||
|
Loading…
Reference in New Issue
Block a user