1
0
mirror of https://github.com/systemd/systemd.git synced 2025-08-03 08:22:21 +03:00

udev/v4l_id: use O_CLOEXEC|O_NOCTTY

This is the usual set of flags. O_CLOEXEC doesn't matter because we don't spawn
anything, but O_NOCTTY could possibly make a difference if the helper is called
on a wrong device type.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2023-03-16 16:40:00 +01:00
parent 8a4c11e0e2
commit 42fff80cb8

View File

@ -74,7 +74,7 @@ static int run(int argc, char *argv[]) {
if (r <= 0)
return r;
fd = open(arg_device, O_RDONLY);
fd = open(arg_device, O_RDONLY|O_CLOEXEC|O_NOCTTY);
if (fd < 0)
return log_error_errno(errno, "Failed to open %s: %m", arg_device);