summaryrefslogtreecommitdiff
path: root/src/basic/fileio.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2021-09-14 23:11:55 +0200
committerLennart Poettering <lennart@poettering.net>2021-09-15 16:19:45 +0200
commitbe991d7678c35aa037ef79672c0c70781eebed9c (patch)
tree3952bc196f72700a1ccfd84212297919b405229f /src/basic/fileio.c
parent7ab7547a40d456d34120b2f44b26385ac1338ebd (diff)
downloadsystemd-be991d7678c35aa037ef79672c0c70781eebed9c.tar.gz
fileio: set O_NOCTTY when reading virtual files
Better be safe than sorry, maybe someone points this call to a TTY one day, and we'd rather not make it our controlling TTY in that case.
Diffstat (limited to 'src/basic/fileio.c')
-rw-r--r--src/basic/fileio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/basic/fileio.c b/src/basic/fileio.c
index af7ae5b1b8..efed64cda0 100644
--- a/src/basic/fileio.c
+++ b/src/basic/fileio.c
@@ -395,7 +395,7 @@ int read_virtual_file(const char *filename, size_t max_size, char **ret_contents
* contents* may be returned. (Though the read is still done using one syscall.) Returns 0 on
* partial success, 1 if untruncated contents were read. */
- fd = open(filename, O_RDONLY|O_CLOEXEC);
+ fd = open(filename, O_RDONLY|O_NOCTTY|O_CLOEXEC);
if (fd < 0)
return -errno;