From: Zbigniew Jędrzejewski-Szmek Date: Thu, 16 Mar 2023 15:40:00 +0000 (+0100) Subject: udev/v4l_id: use O_CLOEXEC|O_NOCTTY X-Git-Tag: v254-rc1~936^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=42fff80cb8fcd0df2d22d9875319a8e6c52efcae;p=thirdparty%2Fsystemd.git 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. --- 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);