diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-02-19 19:39:08 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-02-20 22:02:18 +0100 |
commit | df8067ef6d341efe8f86c6b24c7fb27fc6056bc1 (patch) | |
tree | 89f56d8efae5211906f0598c35374883d91d04e1 /src/import/importd.c | |
parent | core/killall: add (void) (diff) | |
download | systemd-df8067ef6d341efe8f86c6b24c7fb27fc6056bc1.tar.xz systemd-df8067ef6d341efe8f86c6b24c7fb27fc6056bc1.zip |
importd: check setenv return value
CID #1368235.
Diffstat (limited to '')
-rw-r--r-- | src/import/importd.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/import/importd.c b/src/import/importd.c index 9d31a956a5..3d379d6de9 100644 --- a/src/import/importd.c +++ b/src/import/importd.c @@ -449,8 +449,11 @@ static int transfer_start(Transfer *t) { stdio_unset_cloexec(); - setenv("SYSTEMD_LOG_TARGET", "console-prefixed", 1); - setenv("NOTIFY_SOCKET", "/run/systemd/import/notify", 1); + if (setenv("SYSTEMD_LOG_TARGET", "console-prefixed", 1) < 0 || + setenv("NOTIFY_SOCKET", "/run/systemd/import/notify", 1) < 0) { + log_error_errno(errno, "setenv() failed: %m"); + _exit(EXIT_FAILURE); + } if (IN_SET(t->type, TRANSFER_IMPORT_TAR, TRANSFER_IMPORT_RAW)) cmd[k++] = SYSTEMD_IMPORT_PATH; |