summaryrefslogtreecommitdiff
path: root/src/udev/udevadm-lock.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2022-09-10 01:56:19 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2022-09-10 07:16:43 +0900
commit32703bd14cc6c11354795e1c600b1618944722ae (patch)
tree0940d60e9d83b6158bca711949096a5fd4743e4b /src/udev/udevadm-lock.c
parent9a18458834ed6fe560879b2ddd6909d26b755fa3 (diff)
downloadsystemd-32703bd14cc6c11354795e1c600b1618944722ae.tar.gz
udev: always open with O_NOCTTY
All files or device nodes opened here should not be console tty. Let's open it the flags for safety.
Diffstat (limited to 'src/udev/udevadm-lock.c')
-rw-r--r--src/udev/udevadm-lock.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/udev/udevadm-lock.c b/src/udev/udevadm-lock.c
index a3be2336af..35e9999c01 100644
--- a/src/udev/udevadm-lock.c
+++ b/src/udev/udevadm-lock.c
@@ -180,7 +180,7 @@ static int lock_device(
struct stat st;
int r;
- fd = open(path, O_RDONLY|O_CLOEXEC|O_NONBLOCK);
+ fd = open(path, O_RDONLY|O_CLOEXEC|O_NONBLOCK|O_NOCTTY);
if (fd < 0)
return log_error_errno(errno, "Failed to open '%s': %m", path);