From: Mike Yuan Date: Mon, 24 Jun 2024 16:26:15 +0000 (+0200) Subject: core/exec-invoke: reopen OpenFile= fds with O_NOCTTY X-Git-Tag: v257-rc1~1064^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b9c5d812d5132ea1d6a7146be80d41ae2ccb288e;p=thirdparty%2Fsystemd.git core/exec-invoke: reopen OpenFile= fds with O_NOCTTY --- diff --git a/src/core/exec-invoke.c b/src/core/exec-invoke.c index 45f1539f758..254f014141e 100644 --- a/src/core/exec-invoke.c +++ b/src/core/exec-invoke.c @@ -3776,7 +3776,7 @@ static int get_open_file_fd(const ExecContext *c, const ExecParameters *p, const else if (FLAGS_SET(of->flags, OPENFILE_TRUNCATE)) flags |= O_TRUNC; - fd = fd_reopen(ofd, flags | O_CLOEXEC); + fd = fd_reopen(ofd, flags|O_NOCTTY|O_CLOEXEC); if (fd < 0) return log_exec_error_errno(c, p, fd, "Failed to reopen file '%s': %m", of->path);