]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
portable: reopen socket with O_RDONLY
authorLuca Boccassi <bluca@debian.org>
Thu, 3 Feb 2022 17:43:45 +0000 (17:43 +0000)
committerLuca Boccassi <luca.boccassi@gmail.com>
Thu, 3 Feb 2022 22:50:56 +0000 (22:50 +0000)
Follow-up for e3f7ed944ae750a40685c52349f3cc850db0876e

src/portable/portable.c

index 325cb702c51c24b1d3866803f00a4444a3b0c921..d91ce7bc71ce752fb29734839d1612d1b23f8b38 100644 (file)
@@ -611,7 +611,7 @@ static int extract_image_and_extensions(
                         continue;
 
                 /* We need to keep the fd valid, to return the PortableMetadata to the caller. */
-                extension_release_fd = fd_reopen(extension_release_meta->fd, O_CLOEXEC);
+                extension_release_fd = fd_reopen(extension_release_meta->fd, O_CLOEXEC|O_RDONLY);
                 if (extension_release_fd < 0)
                         return extension_release_fd;