]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/basic/memfd-util.c
memfd-util: memfd may also have F_SEAL_EXEC flag
[thirdparty/systemd.git] / src / basic / memfd-util.c
index 285abd41d3a0d42616c135d06dacd0b961c0f3ec..3e99ab04801c519ab93003fb61c10bf4c032b578 100644 (file)
@@ -106,7 +106,8 @@ int memfd_get_sealed(int fd) {
         if (r < 0)
                 return -errno;
 
-        return r == (F_SEAL_SHRINK | F_SEAL_GROW | F_SEAL_WRITE | F_SEAL_SEAL);
+        /* We ignore F_SEAL_EXEC here to support older kernels. */
+        return FLAGS_SET(r, F_SEAL_SHRINK | F_SEAL_GROW | F_SEAL_WRITE | F_SEAL_SEAL);
 }
 
 int memfd_get_size(int fd, uint64_t *sz) {