Home
last modified time | relevance | path

Searched refs:ruleset_fd (Results 1 – 4 of 4) sorted by relevance

/tools/testing/selftests/landlock/
Dfs_test.c354 int ruleset_fd; in TEST_F_FORK() local
360 ruleset_fd = open(dir_s1d1, O_PATH | O_DIRECTORY | O_CLOEXEC); in TEST_F_FORK()
361 ASSERT_LE(0, ruleset_fd); in TEST_F_FORK()
362 ASSERT_EQ(-1, landlock_add_rule(ruleset_fd, LANDLOCK_RULE_PATH_BENEATH, in TEST_F_FORK()
366 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
368 ruleset_fd = open(dir_s1d1, O_DIRECTORY | O_CLOEXEC); in TEST_F_FORK()
369 ASSERT_LE(0, ruleset_fd); in TEST_F_FORK()
370 ASSERT_EQ(-1, landlock_add_rule(ruleset_fd, LANDLOCK_RULE_PATH_BENEATH, in TEST_F_FORK()
374 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
377 ruleset_fd = in TEST_F_FORK()
[all …]
Dbase_test.c105 int ruleset_fd; in TEST() local
137 ruleset_fd = in TEST()
139 ASSERT_LE(0, ruleset_fd); in TEST()
140 ASSERT_EQ(0, close(ruleset_fd)); in TEST()
153 const int ruleset_fd = in TEST() local
156 ASSERT_LE(0, ruleset_fd); in TEST()
167 ASSERT_EQ(-1, landlock_add_rule(ruleset_fd, 0, NULL, 0)); in TEST()
171 ASSERT_EQ(-1, landlock_add_rule(ruleset_fd, LANDLOCK_RULE_PATH_BENEATH, in TEST()
176 ASSERT_EQ(-1, landlock_add_rule(ruleset_fd, LANDLOCK_RULE_PATH_BENEATH, in TEST()
184 ASSERT_EQ(0, landlock_add_rule(ruleset_fd, LANDLOCK_RULE_PATH_BENEATH, in TEST()
[all …]
Dcommon.h91 static inline int landlock_add_rule(const int ruleset_fd, in landlock_add_rule() argument
96 return syscall(__NR_landlock_add_rule, ruleset_fd, rule_type, rule_attr, in landlock_add_rule()
102 static inline int landlock_restrict_self(const int ruleset_fd, in landlock_restrict_self() argument
105 return syscall(__NR_landlock_restrict_self, ruleset_fd, flags); in landlock_restrict_self()
Dptrace_test.c30 int ruleset_fd; in create_domain() local
35 ruleset_fd = in create_domain()
37 EXPECT_LE(0, ruleset_fd) in create_domain()
42 EXPECT_EQ(0, landlock_restrict_self(ruleset_fd, 0)); in create_domain()
43 EXPECT_EQ(0, close(ruleset_fd)); in create_domain()