From 42fff80cb8fcd0df2d22d9875319a8e6c52efcae Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 16 Mar 2023 16:40:00 +0100 Subject: [PATCH] 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. --- src/udev/v4l_id/v4l_id.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/udev/v4l_id/v4l_id.c b/src/udev/v4l_id/v4l_id.c index 1d176a387e5..30527e9556d 100644 --- a/src/udev/v4l_id/v4l_id.c +++ b/src/udev/v4l_id/v4l_id.c @@ -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); -- 2.47.3