1
0
mirror of https://github.com/systemd/systemd synced 2024-07-01 07:34:28 +00:00

core/exec-invoke: reopen OpenFile= fds with O_NOCTTY

This commit is contained in:
Mike Yuan 2024-06-24 18:26:15 +02:00
parent 21ab3f505a
commit b9c5d812d5
No known key found for this signature in database
GPG Key ID: 417471C0A40F58B3

View File

@ -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);