diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-09-10 01:56:19 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-09-10 07:16:43 +0900 |
commit | 32703bd14cc6c11354795e1c600b1618944722ae (patch) | |
tree | 0940d60e9d83b6158bca711949096a5fd4743e4b /src/udev/udev-builtin-btrfs.c | |
parent | 9a18458834ed6fe560879b2ddd6909d26b755fa3 (diff) | |
download | systemd-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/udev-builtin-btrfs.c')
-rw-r--r-- | src/udev/udev-builtin-btrfs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/udev/udev-builtin-btrfs.c b/src/udev/udev-builtin-btrfs.c index f9d4f1dd4e..8cd627807f 100644 --- a/src/udev/udev-builtin-btrfs.c +++ b/src/udev/udev-builtin-btrfs.c @@ -21,7 +21,7 @@ static int builtin_btrfs(sd_device *dev, sd_netlink **rtnl, int argc, char *argv if (argc != 3 || !streq(argv[1], "ready")) return log_device_error_errno(dev, SYNTHETIC_ERRNO(EINVAL), "Invalid arguments"); - fd = open("/dev/btrfs-control", O_RDWR|O_CLOEXEC); + fd = open("/dev/btrfs-control", O_RDWR|O_CLOEXEC|O_NOCTTY); if (fd < 0) { if (ERRNO_IS_DEVICE_ABSENT(errno)) { /* Driver not installed? Then we aren't ready. This is useful in initrds that lack |