We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ec2798d commit ec12a8dCopy full SHA for ec12a8d
tools/testing/selftests/landlock/base_test.c
@@ -277,6 +277,17 @@ TEST(restrict_self_checks_ordering)
277
ASSERT_EQ(0, close(ruleset_fd));
278
}
279
280
+TEST(restrict_self_fd)
281
+{
282
+ int fd;
283
+
284
+ fd = open("/dev/null", O_RDONLY | O_CLOEXEC);
285
+ ASSERT_LE(0, fd);
286
287
+ EXPECT_EQ(-1, landlock_restrict_self(fd, 0));
288
+ EXPECT_EQ(EBADFD, errno);
289
+}
290
291
TEST(ruleset_fd_io)
292
{
293
struct landlock_ruleset_attr ruleset_attr = {
0 commit comments