Lines Matching refs:ASSERT_EQ
205 ASSERT_EQ(0, mkdir(path, 0700)) in create_directory()
216 ASSERT_EQ(0, mknod(path, S_IFREG | 0700, 0)) in create_file()
289 ASSERT_EQ(0, unshare(CLONE_NEWNS | CLONE_NEWCGROUP)); in prepare_layout_opt()
290 ASSERT_EQ(0, mount_opt(mnt, TMP_DIR)) in prepare_layout_opt()
302 ASSERT_EQ(0, mount(NULL, TMP_DIR, NULL, MS_PRIVATE | MS_REC, NULL)); in prepare_layout_opt()
321 ASSERT_EQ(EINVAL, errno); in cleanup_layout()
358 ASSERT_EQ(0, mount_opt(&mnt_tmp, dir_s3d2)); in create_layout1()
361 ASSERT_EQ(0, mkdir(dir_s3d3, 0700)); in create_layout1()
435 ASSERT_EQ(0, test_open(dir_s1d1, O_RDONLY)); in TEST_F_FORK()
436 ASSERT_EQ(0, test_open(file1_s1d1, O_RDONLY)); in TEST_F_FORK()
437 ASSERT_EQ(0, test_open(file2_s1d1, O_RDONLY)); in TEST_F_FORK()
438 ASSERT_EQ(0, test_open(dir_s1d2, O_RDONLY)); in TEST_F_FORK()
439 ASSERT_EQ(0, test_open(file1_s1d2, O_RDONLY)); in TEST_F_FORK()
440 ASSERT_EQ(0, test_open(file2_s1d2, O_RDONLY)); in TEST_F_FORK()
441 ASSERT_EQ(0, test_open(dir_s1d3, O_RDONLY)); in TEST_F_FORK()
442 ASSERT_EQ(0, test_open(file1_s1d3, O_RDONLY)); in TEST_F_FORK()
444 ASSERT_EQ(0, test_open(dir_s2d1, O_RDONLY)); in TEST_F_FORK()
445 ASSERT_EQ(0, test_open(file1_s2d1, O_RDONLY)); in TEST_F_FORK()
446 ASSERT_EQ(0, test_open(dir_s2d2, O_RDONLY)); in TEST_F_FORK()
447 ASSERT_EQ(0, test_open(file1_s2d2, O_RDONLY)); in TEST_F_FORK()
448 ASSERT_EQ(0, test_open(dir_s2d3, O_RDONLY)); in TEST_F_FORK()
449 ASSERT_EQ(0, test_open(file1_s2d3, O_RDONLY)); in TEST_F_FORK()
451 ASSERT_EQ(0, test_open(dir_s3d1, O_RDONLY)); in TEST_F_FORK()
452 ASSERT_EQ(0, test_open(dir_s3d2, O_RDONLY)); in TEST_F_FORK()
453 ASSERT_EQ(0, test_open(dir_s3d3, O_RDONLY)); in TEST_F_FORK()
475 ASSERT_EQ(-1, landlock_add_rule(ruleset_fd, LANDLOCK_RULE_PATH_BENEATH, in TEST_F_FORK()
478 ASSERT_EQ(EBADF, errno); in TEST_F_FORK()
479 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
483 ASSERT_EQ(-1, landlock_add_rule(ruleset_fd, LANDLOCK_RULE_PATH_BENEATH, in TEST_F_FORK()
486 ASSERT_EQ(EBADFD, errno); in TEST_F_FORK()
487 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
493 ASSERT_EQ(0, landlock_add_rule(ruleset_fd, LANDLOCK_RULE_PATH_BENEATH, in TEST_F_FORK()
495 ASSERT_EQ(0, close(path_beneath.parent_fd)); in TEST_F_FORK()
500 ASSERT_EQ(0, landlock_add_rule(ruleset_fd, LANDLOCK_RULE_PATH_BENEATH, in TEST_F_FORK()
502 ASSERT_EQ(0, close(path_beneath.parent_fd)); in TEST_F_FORK()
506 ASSERT_EQ(-1, landlock_add_rule(ruleset_fd, LANDLOCK_RULE_PATH_BENEATH, in TEST_F_FORK()
508 ASSERT_EQ(EBADFD, errno); in TEST_F_FORK()
517 ASSERT_EQ(-1, landlock_add_rule(ruleset_fd, LANDLOCK_RULE_PATH_BENEATH, in TEST_F_FORK()
519 ASSERT_EQ(EINVAL, errno); in TEST_F_FORK()
524 ASSERT_EQ(-1, landlock_add_rule(ruleset_fd, LANDLOCK_RULE_PATH_BENEATH, in TEST_F_FORK()
526 ASSERT_EQ(EINVAL, errno); in TEST_F_FORK()
531 ASSERT_EQ(-1, landlock_add_rule(ruleset_fd, LANDLOCK_RULE_PATH_BENEATH, in TEST_F_FORK()
533 ASSERT_EQ(EINVAL, errno); in TEST_F_FORK()
538 ASSERT_EQ(-1, landlock_add_rule(ruleset_fd, LANDLOCK_RULE_PATH_BENEATH, in TEST_F_FORK()
540 ASSERT_EQ(ENOMSG, errno); in TEST_F_FORK()
543 ASSERT_EQ(0, close(path_beneath.parent_fd)); in TEST_F_FORK()
546 ASSERT_EQ(0, prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0)); in TEST_F_FORK()
547 ASSERT_EQ(0, landlock_restrict_self(ruleset_fd, 0)); in TEST_F_FORK()
549 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
604 ASSERT_EQ(0, landlock_add_rule(ruleset_fd, in TEST_F_FORK()
612 ASSERT_EQ(0, err); in TEST_F_FORK()
614 ASSERT_EQ(-1, err); in TEST_F_FORK()
615 ASSERT_EQ(EINVAL, errno); in TEST_F_FORK()
618 ASSERT_EQ(0, close(path_beneath_file.parent_fd)); in TEST_F_FORK()
619 ASSERT_EQ(0, close(path_beneath_dir.parent_fd)); in TEST_F_FORK()
620 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
633 ASSERT_EQ(-1, landlock_create_ruleset(&ruleset_attr, in TEST_F_FORK()
635 ASSERT_EQ(EINVAL, errno); in TEST_F_FORK()
662 ASSERT_EQ(0, close(path_beneath.parent_fd)); in TEST_F_FORK()
663 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
714 ASSERT_EQ(0, landlock_add_rule(ruleset_fd, LANDLOCK_RULE_PATH_BENEATH, in add_path_beneath()
720 ASSERT_EQ(0, close(path_beneath.parent_fd)); in add_path_beneath()
791 ASSERT_EQ(0, test_open("/proc/self/ns/mnt", O_RDONLY)); in TEST_F_FORK()
795 ASSERT_EQ(EACCES, test_open("/", O_RDONLY)); in TEST_F_FORK()
796 ASSERT_EQ(EACCES, test_open("/dev", O_RDONLY)); in TEST_F_FORK()
797 ASSERT_EQ(0, test_open("/dev/null", O_RDONLY)); in TEST_F_FORK()
798 ASSERT_EQ(EACCES, test_open("/dev/full", O_RDONLY)); in TEST_F_FORK()
800 ASSERT_EQ(EACCES, test_open("/proc", O_RDONLY)); in TEST_F_FORK()
801 ASSERT_EQ(EACCES, test_open("/proc/self", O_RDONLY)); in TEST_F_FORK()
802 ASSERT_EQ(EACCES, test_open("/proc/self/ns", O_RDONLY)); in TEST_F_FORK()
808 ASSERT_EQ(0, test_open("/proc/self/ns/mnt", O_RDONLY)); in TEST_F_FORK()
818 ASSERT_EQ(-1, landlock_add_rule(ruleset_fd, LANDLOCK_RULE_PATH_BENEATH, in TEST_F_FORK()
820 ASSERT_EQ(EBADFD, errno); in TEST_F_FORK()
821 ASSERT_EQ(0, close(path_beneath.parent_fd)); in TEST_F_FORK()
839 ASSERT_EQ(-1, landlock_restrict_self(ruleset_fd, 0)); in TEST_F_FORK()
840 ASSERT_EQ(EPERM, errno); in TEST_F_FORK()
844 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
867 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
870 ASSERT_EQ(EACCES, test_open("/", O_RDONLY)); in TEST_F_FORK()
871 ASSERT_EQ(0, test_open("/", O_RDONLY | O_PATH)); in TEST_F_FORK()
872 ASSERT_EQ(EACCES, test_open(dir_s1d1, O_RDONLY)); in TEST_F_FORK()
873 ASSERT_EQ(0, test_open(dir_s1d1, O_RDONLY | O_PATH)); in TEST_F_FORK()
874 ASSERT_EQ(EACCES, test_open(file1_s1d1, O_RDONLY)); in TEST_F_FORK()
875 ASSERT_EQ(0, test_open(file1_s1d1, O_RDONLY | O_PATH)); in TEST_F_FORK()
877 ASSERT_EQ(0, test_open(dir_s1d2, O_RDONLY)); in TEST_F_FORK()
878 ASSERT_EQ(0, test_open(file1_s1d2, O_RDONLY)); in TEST_F_FORK()
879 ASSERT_EQ(0, test_open(dir_s1d3, O_RDONLY)); in TEST_F_FORK()
880 ASSERT_EQ(0, test_open(file1_s1d3, O_RDONLY)); in TEST_F_FORK()
883 ASSERT_EQ(EACCES, test_open(dir_s2d2, O_RDONLY)); in TEST_F_FORK()
884 ASSERT_EQ(0, test_open(dir_s2d2, O_RDONLY | O_PATH)); in TEST_F_FORK()
886 ASSERT_EQ(0, test_open(file1_s2d2, O_RDONLY)); in TEST_F_FORK()
891 ASSERT_EQ(1, write(reg_fd, ".", 1)); in TEST_F_FORK()
893 ASSERT_EQ(1, read(reg_fd, &buf, 1)); in TEST_F_FORK()
894 ASSERT_EQ('.', buf); in TEST_F_FORK()
895 ASSERT_EQ(0, close(reg_fd)); in TEST_F_FORK()
900 ASSERT_EQ(-1, write(reg_fd, &buf, 1)); in TEST_F_FORK()
901 ASSERT_EQ(EBADF, errno); in TEST_F_FORK()
902 ASSERT_EQ(0, close(reg_fd)); in TEST_F_FORK()
919 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
925 ASSERT_EQ(0, test_open(file1_s1d1, O_WRONLY)); in TEST_F_FORK()
926 ASSERT_EQ(EACCES, test_open(file1_s1d1, O_RDWR)); in TEST_F_FORK()
928 ASSERT_EQ(0, test_open(file1_s1d2, O_WRONLY)); in TEST_F_FORK()
929 ASSERT_EQ(0, test_open(file1_s1d2, O_RDWR)); in TEST_F_FORK()
952 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
955 ASSERT_EQ(EACCES, test_open(file1_s1d1, O_RDONLY)); in TEST_F_FORK()
956 ASSERT_EQ(EACCES, test_open(file1_s1d1, O_WRONLY)); in TEST_F_FORK()
957 ASSERT_EQ(EACCES, test_open(file1_s1d1, O_RDWR)); in TEST_F_FORK()
958 ASSERT_EQ(EACCES, test_open(dir_s1d1, O_RDONLY | O_DIRECTORY)); in TEST_F_FORK()
961 ASSERT_EQ(0, test_open(file1_s1d2, O_RDONLY)); in TEST_F_FORK()
962 ASSERT_EQ(0, test_open(file1_s1d2, O_WRONLY)); in TEST_F_FORK()
963 ASSERT_EQ(0, test_open(file1_s1d2, O_RDWR)); in TEST_F_FORK()
964 ASSERT_EQ(0, test_open(dir_s1d2, O_RDONLY | O_DIRECTORY)); in TEST_F_FORK()
967 ASSERT_EQ(0, test_open(file1_s1d3, O_RDONLY)); in TEST_F_FORK()
968 ASSERT_EQ(0, test_open(file1_s1d3, O_WRONLY)); in TEST_F_FORK()
969 ASSERT_EQ(0, test_open(file1_s1d3, O_RDWR)); in TEST_F_FORK()
970 ASSERT_EQ(0, test_open(dir_s1d3, O_RDONLY | O_DIRECTORY)); in TEST_F_FORK()
1008 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
1011 ASSERT_EQ(EACCES, test_open(file1_s1d1, O_RDONLY)); in TEST_F_FORK()
1012 ASSERT_EQ(EACCES, test_open(file1_s1d1, O_WRONLY)); in TEST_F_FORK()
1013 ASSERT_EQ(EACCES, test_open(file1_s1d1, O_RDWR)); in TEST_F_FORK()
1014 ASSERT_EQ(EACCES, test_open(dir_s1d1, O_RDONLY | O_DIRECTORY)); in TEST_F_FORK()
1017 ASSERT_EQ(0, test_open(file1_s1d2, O_RDONLY)); in TEST_F_FORK()
1018 ASSERT_EQ(EACCES, test_open(file1_s1d2, O_WRONLY)); in TEST_F_FORK()
1019 ASSERT_EQ(EACCES, test_open(file1_s1d2, O_RDWR)); in TEST_F_FORK()
1020 ASSERT_EQ(EACCES, test_open(dir_s1d1, O_RDONLY | O_DIRECTORY)); in TEST_F_FORK()
1023 ASSERT_EQ(0, test_open(file1_s1d3, O_RDONLY)); in TEST_F_FORK()
1024 ASSERT_EQ(0, test_open(file1_s1d3, O_WRONLY)); in TEST_F_FORK()
1026 ASSERT_EQ(0, test_open(file1_s1d3, O_RDWR)); in TEST_F_FORK()
1027 ASSERT_EQ(EACCES, test_open(dir_s1d1, O_RDONLY | O_DIRECTORY)); in TEST_F_FORK()
1033 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
1036 ASSERT_EQ(EACCES, test_open(file1_s1d1, O_RDONLY)); in TEST_F_FORK()
1037 ASSERT_EQ(EACCES, test_open(file1_s1d1, O_WRONLY)); in TEST_F_FORK()
1038 ASSERT_EQ(EACCES, test_open(file1_s1d1, O_RDWR)); in TEST_F_FORK()
1039 ASSERT_EQ(EACCES, test_open(dir_s1d1, O_RDONLY | O_DIRECTORY)); in TEST_F_FORK()
1042 ASSERT_EQ(0, test_open(file1_s1d2, O_RDONLY)); in TEST_F_FORK()
1043 ASSERT_EQ(EACCES, test_open(file1_s1d2, O_WRONLY)); in TEST_F_FORK()
1044 ASSERT_EQ(EACCES, test_open(file1_s1d2, O_RDWR)); in TEST_F_FORK()
1045 ASSERT_EQ(EACCES, test_open(dir_s1d1, O_RDONLY | O_DIRECTORY)); in TEST_F_FORK()
1048 ASSERT_EQ(0, test_open(file1_s1d3, O_RDONLY)); in TEST_F_FORK()
1049 ASSERT_EQ(0, test_open(file1_s1d3, O_WRONLY)); in TEST_F_FORK()
1051 ASSERT_EQ(0, test_open(file1_s1d3, O_RDWR)); in TEST_F_FORK()
1052 ASSERT_EQ(EACCES, test_open(dir_s1d1, O_RDONLY | O_DIRECTORY)); in TEST_F_FORK()
1058 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
1061 ASSERT_EQ(EACCES, test_open(file1_s1d1, O_RDONLY)); in TEST_F_FORK()
1062 ASSERT_EQ(EACCES, test_open(file1_s1d1, O_WRONLY)); in TEST_F_FORK()
1063 ASSERT_EQ(EACCES, test_open(file1_s1d1, O_RDWR)); in TEST_F_FORK()
1064 ASSERT_EQ(EACCES, test_open(dir_s1d1, O_RDONLY | O_DIRECTORY)); in TEST_F_FORK()
1067 ASSERT_EQ(EACCES, test_open(file1_s1d2, O_RDONLY)); in TEST_F_FORK()
1068 ASSERT_EQ(EACCES, test_open(file1_s1d2, O_WRONLY)); in TEST_F_FORK()
1069 ASSERT_EQ(EACCES, test_open(file1_s1d2, O_RDWR)); in TEST_F_FORK()
1070 ASSERT_EQ(EACCES, test_open(dir_s1d1, O_RDONLY | O_DIRECTORY)); in TEST_F_FORK()
1073 ASSERT_EQ(EACCES, test_open(file1_s1d3, O_RDONLY)); in TEST_F_FORK()
1074 ASSERT_EQ(0, test_open(file1_s1d3, O_WRONLY)); in TEST_F_FORK()
1076 ASSERT_EQ(EACCES, test_open(file1_s1d3, O_RDWR)); in TEST_F_FORK()
1077 ASSERT_EQ(EACCES, test_open(dir_s1d1, O_RDONLY | O_DIRECTORY)); in TEST_F_FORK()
1098 ASSERT_EQ(0, unlink(file1_s1d1)); in TEST_F_FORK()
1099 ASSERT_EQ(0, unlink(file1_s1d2)); in TEST_F_FORK()
1105 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
1107 ASSERT_EQ(-1, mknod(file1_s1d1, S_IFREG | 0700, 0)); in TEST_F_FORK()
1108 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
1109 ASSERT_EQ(0, mknod(file1_s1d2, S_IFREG | 0700, 0)); in TEST_F_FORK()
1110 ASSERT_EQ(0, unlink(file1_s1d2)); in TEST_F_FORK()
1116 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
1119 ASSERT_EQ(-1, mknod(file1_s1d1, S_IFREG | 0700, 0)); in TEST_F_FORK()
1120 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
1121 ASSERT_EQ(0, mknod(file1_s1d2, S_IFREG | 0700, 0)); in TEST_F_FORK()
1124 ASSERT_EQ(-1, unlink(file1_s1d2)); in TEST_F_FORK()
1125 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
1126 ASSERT_EQ(0, unlink(file1_s1d3)); in TEST_F_FORK()
1226 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
1229 ASSERT_EQ(0, test_open(file1_s1d3, O_RDWR)); in TEST_F_FORK()
1230 ASSERT_EQ(EACCES, test_open(file2_s1d3, O_RDONLY)); in TEST_F_FORK()
1231 ASSERT_EQ(0, test_open(file2_s1d3, O_WRONLY)); in TEST_F_FORK()
1239 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
1242 ASSERT_EQ(0, test_open(file1_s1d3, O_RDWR)); in TEST_F_FORK()
1243 ASSERT_EQ(EACCES, test_open(file2_s1d3, O_RDONLY)); in TEST_F_FORK()
1244 ASSERT_EQ(0, test_open(file2_s1d3, O_WRONLY)); in TEST_F_FORK()
1250 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
1253 ASSERT_EQ(0, test_open(file1_s1d3, O_RDWR)); in TEST_F_FORK()
1254 ASSERT_EQ(EACCES, test_open(file2_s1d3, O_RDONLY)); in TEST_F_FORK()
1255 ASSERT_EQ(0, test_open(file2_s1d3, O_WRONLY)); in TEST_F_FORK()
1264 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
1270 ASSERT_EQ(0, test_open(file1_s1d3, O_RDONLY)); in TEST_F_FORK()
1271 ASSERT_EQ(EACCES, test_open(file1_s1d3, O_WRONLY)); in TEST_F_FORK()
1272 ASSERT_EQ(EACCES, test_open(file2_s1d3, O_RDONLY)); in TEST_F_FORK()
1273 ASSERT_EQ(EACCES, test_open(file2_s1d3, O_WRONLY)); in TEST_F_FORK()
1279 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
1282 ASSERT_EQ(0, test_open(file1_s1d3, O_RDONLY)); in TEST_F_FORK()
1283 ASSERT_EQ(EACCES, test_open(file1_s1d3, O_WRONLY)); in TEST_F_FORK()
1284 ASSERT_EQ(EACCES, test_open(file2_s1d3, O_WRONLY)); in TEST_F_FORK()
1285 ASSERT_EQ(EACCES, test_open(file2_s1d3, O_RDONLY)); in TEST_F_FORK()
1291 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
1294 ASSERT_EQ(0, test_open(file1_s1d3, O_RDONLY)); in TEST_F_FORK()
1295 ASSERT_EQ(EACCES, test_open(file1_s1d3, O_WRONLY)); in TEST_F_FORK()
1296 ASSERT_EQ(EACCES, test_open(file2_s1d3, O_WRONLY)); in TEST_F_FORK()
1297 ASSERT_EQ(EACCES, test_open(file2_s1d3, O_RDONLY)); in TEST_F_FORK()
1305 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
1308 ASSERT_EQ(EACCES, test_open(file1_s1d3, O_RDONLY)); in TEST_F_FORK()
1309 ASSERT_EQ(EACCES, test_open(file1_s1d3, O_WRONLY)); in TEST_F_FORK()
1310 ASSERT_EQ(EACCES, test_open(file2_s1d3, O_WRONLY)); in TEST_F_FORK()
1311 ASSERT_EQ(EACCES, test_open(file2_s1d3, O_RDONLY)); in TEST_F_FORK()
1329 ASSERT_EQ(EACCES, test_open(file1_s1d1, O_WRONLY)); in TEST_F_FORK()
1330 ASSERT_EQ(EACCES, test_open(dir_s1d1, O_RDONLY | O_DIRECTORY)); in TEST_F_FORK()
1333 ASSERT_EQ(EACCES, test_open(file1_s1d2, O_WRONLY)); in TEST_F_FORK()
1335 ASSERT_EQ(0, test_open(dir_s1d2, O_RDONLY | O_DIRECTORY)); in TEST_F_FORK()
1338 ASSERT_EQ(EACCES, test_open(file1_s1d3, O_WRONLY)); in TEST_F_FORK()
1340 ASSERT_EQ(0, test_open(dir_s1d3, O_RDONLY | O_DIRECTORY)); in TEST_F_FORK()
1363 ASSERT_EQ(EACCES, test_open(file1_s1d1, O_WRONLY)); in TEST_F_FORK()
1364 ASSERT_EQ(EACCES, test_open(dir_s1d1, O_RDONLY | O_DIRECTORY)); in TEST_F_FORK()
1367 ASSERT_EQ(EACCES, test_open(file1_s1d2, O_WRONLY)); in TEST_F_FORK()
1369 ASSERT_EQ(0, test_open(dir_s1d2, O_RDONLY | O_DIRECTORY)); in TEST_F_FORK()
1372 ASSERT_EQ(EACCES, test_open(file1_s1d3, O_WRONLY)); in TEST_F_FORK()
1374 ASSERT_EQ(0, test_open(dir_s1d3, O_RDONLY | O_DIRECTORY)); in TEST_F_FORK()
1384 ASSERT_EQ(EACCES, test_open(file1_s1d1, O_WRONLY)); in TEST_F_FORK()
1385 ASSERT_EQ(EACCES, test_open(dir_s1d1, O_RDONLY | O_DIRECTORY)); in TEST_F_FORK()
1388 ASSERT_EQ(EACCES, test_open(file1_s1d2, O_WRONLY)); in TEST_F_FORK()
1390 ASSERT_EQ(0, test_open(dir_s1d2, O_RDONLY | O_DIRECTORY)); in TEST_F_FORK()
1393 ASSERT_EQ(EACCES, test_open(file1_s1d3, O_WRONLY)); in TEST_F_FORK()
1395 ASSERT_EQ(0, test_open(dir_s1d3, O_RDONLY | O_DIRECTORY)); in TEST_F_FORK()
1405 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
1414 ASSERT_EQ(EACCES, test_open(file1_s1d1, O_WRONLY)); in TEST_F_FORK()
1415 ASSERT_EQ(EACCES, test_open(dir_s1d1, O_RDONLY | O_DIRECTORY)); in TEST_F_FORK()
1418 ASSERT_EQ(EACCES, test_open(file1_s1d2, O_WRONLY)); in TEST_F_FORK()
1420 ASSERT_EQ(0, test_open(dir_s1d2, O_RDONLY | O_DIRECTORY)); in TEST_F_FORK()
1423 ASSERT_EQ(EACCES, test_open(file1_s1d3, O_WRONLY)); in TEST_F_FORK()
1428 ASSERT_EQ(0, test_open(dir_s1d3, O_RDONLY | O_DIRECTORY)); in TEST_F_FORK()
1446 ASSERT_EQ(EACCES, test_open(dir_s1d2, O_RDONLY | O_DIRECTORY)); in TEST_F_FORK()
1448 ASSERT_EQ(0, test_open(dir_s1d3, O_RDONLY | O_DIRECTORY)); in TEST_F_FORK()
1450 ASSERT_EQ(0, test_open(file1_s1d3, O_RDONLY)); in TEST_F_FORK()
1458 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
1461 ASSERT_EQ(EACCES, test_open(dir_s1d2, O_RDONLY | O_DIRECTORY)); in TEST_F_FORK()
1463 ASSERT_EQ(0, test_open(dir_s1d3, O_RDONLY | O_DIRECTORY)); in TEST_F_FORK()
1465 ASSERT_EQ(0, test_open(file1_s1d3, O_RDONLY)); in TEST_F_FORK()
1486 ASSERT_EQ(-1, err); in TEST_F_FORK()
1487 ASSERT_EQ(E2BIG, errno); in TEST_F_FORK()
1489 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
1501 ASSERT_EQ(ENOMSG, errno); in TEST_F_FORK()
1509 ASSERT_EQ(EACCES, test_open(file1_s1d1, O_RDONLY)); in TEST_F_FORK()
1510 ASSERT_EQ(0, test_open(dir_s1d1, O_RDONLY)); in TEST_F_FORK()
1518 ASSERT_EQ(EACCES, test_open(file1_s1d1, O_RDONLY)); in TEST_F_FORK()
1519 ASSERT_EQ(EACCES, test_open(dir_s1d1, O_RDONLY)); in TEST_F_FORK()
1523 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
1544 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
1546 ASSERT_EQ(0, test_open(dir_s1d1, O_RDONLY)); in TEST_F_FORK()
1548 ASSERT_EQ(EACCES, test_open(dir_s2d1, O_RDONLY)); in TEST_F_FORK()
1550 ASSERT_EQ(EACCES, test_open(dir_s3d1, O_RDONLY)); in TEST_F_FORK()
1551 ASSERT_EQ(0, test_open(dir_s3d2, O_RDONLY)); in TEST_F_FORK()
1552 ASSERT_EQ(0, test_open(dir_s3d3, O_RDONLY)); in TEST_F_FORK()
1573 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
1575 ASSERT_EQ(0, test_open(dir_s1d1, O_RDONLY)); in TEST_F_FORK()
1577 ASSERT_EQ(EACCES, test_open(dir_s2d1, O_RDONLY)); in TEST_F_FORK()
1579 ASSERT_EQ(0, test_open(dir_s3d1, O_RDONLY)); in TEST_F_FORK()
1580 ASSERT_EQ(0, test_open(dir_s3d2, O_RDONLY)); in TEST_F_FORK()
1581 ASSERT_EQ(0, test_open(dir_s3d3, O_RDONLY)); in TEST_F_FORK()
1601 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
1604 ASSERT_EQ(0, test_open("/", O_RDONLY)); in TEST_F_FORK()
1605 ASSERT_EQ(0, test_open(dir_s1d1, O_RDONLY)); in TEST_F_FORK()
1611 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
1614 ASSERT_EQ(EACCES, test_open("/", O_RDONLY)); in TEST_F_FORK()
1615 ASSERT_EQ(EACCES, test_open(dir_s1d1, O_RDONLY)); in TEST_F_FORK()
1631 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
1634 ASSERT_EQ(EACCES, test_open("/", O_RDONLY)); in TEST_F_FORK()
1635 ASSERT_EQ(EACCES, test_open(dir_s1d1, O_RDONLY)); in TEST_F_FORK()
1650 ASSERT_EQ(0, syscall(__NR_pivot_root, dir_s3d2, dir_s3d3)) in TEST_F_FORK()
1654 ASSERT_EQ(0, chdir("/")); in TEST_F_FORK()
1660 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
1662 ASSERT_EQ(0, test_open("s3d3", O_RDONLY)); in TEST_F_FORK()
1663 ASSERT_EQ(EACCES, test_open("/", O_RDONLY)); in TEST_F_FORK()
1679 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
1682 ASSERT_EQ(-1, mount(NULL, dir_s3d2, NULL, MS_RDONLY, NULL)); in TEST_F_FORK()
1683 ASSERT_EQ(EPERM, errno); in TEST_F_FORK()
1684 ASSERT_EQ(-1, syscall(__NR_pivot_root, dir_s3d2, dir_s3d3)); in TEST_F_FORK()
1685 ASSERT_EQ(EPERM, errno); in TEST_F_FORK()
1703 ASSERT_EQ(0, syscall(__NR_move_mount, AT_FDCWD, dir_s3d2, AT_FDCWD, in TEST_F_FORK()
1709 ASSERT_EQ(0, syscall(__NR_move_mount, AT_FDCWD, dir_s1d2, AT_FDCWD, in TEST_F_FORK()
1714 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
1717 ASSERT_EQ(-1, syscall(__NR_move_mount, AT_FDCWD, dir_s3d2, AT_FDCWD, in TEST_F_FORK()
1719 ASSERT_EQ(EPERM, errno); in TEST_F_FORK()
1736 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
1740 ASSERT_EQ(0, mount_opt(&mnt_tmp, dir_s1d2)); in TEST_F_FORK()
1741 ASSERT_EQ(0, mount(NULL, dir_s1d2, NULL, MS_PRIVATE | MS_REC, NULL)); in TEST_F_FORK()
1742 ASSERT_EQ(0, syscall(__NR_move_mount, AT_FDCWD, dir_s1d2, AT_FDCWD, in TEST_F_FORK()
1744 ASSERT_EQ(0, umount(dir_s2d2)); in TEST_F_FORK()
1745 ASSERT_EQ(0, syscall(__NR_pivot_root, dir_s3d2, dir_s3d3)); in TEST_F_FORK()
1746 ASSERT_EQ(0, chdir("/")); in TEST_F_FORK()
1764 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
1768 ASSERT_EQ(-1, mount_opt(&mnt_tmp, dir_s1d2)); in TEST_F_FORK()
1769 ASSERT_EQ(EPERM, errno); in TEST_F_FORK()
1770 ASSERT_EQ(-1, mount(NULL, dir_s3d2, NULL, MS_PRIVATE | MS_REC, NULL)); in TEST_F_FORK()
1771 ASSERT_EQ(EPERM, errno); in TEST_F_FORK()
1772 ASSERT_EQ(-1, syscall(__NR_move_mount, AT_FDCWD, dir_s3d2, AT_FDCWD, in TEST_F_FORK()
1774 ASSERT_EQ(EPERM, errno); in TEST_F_FORK()
1775 ASSERT_EQ(-1, umount(dir_s3d2)); in TEST_F_FORK()
1776 ASSERT_EQ(EPERM, errno); in TEST_F_FORK()
1777 ASSERT_EQ(-1, syscall(__NR_pivot_root, dir_s3d2, dir_s3d3)); in TEST_F_FORK()
1778 ASSERT_EQ(EPERM, errno); in TEST_F_FORK()
1804 ASSERT_EQ(0, umount(dir_s3d2)); in TEST_F_FORK()
1808 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
1810 ASSERT_EQ(0, test_open(file1_s1d1, O_RDONLY)); in TEST_F_FORK()
1811 ASSERT_EQ(EACCES, test_open(dir_s3d2, O_RDONLY)); in TEST_F_FORK()
1813 ASSERT_EQ(ENOENT, test_open(dir_s3d3, O_RDONLY)); in TEST_F_FORK()
1853 ASSERT_EQ(0, close(ruleset_fd)); in test_relative_path()
1863 ASSERT_EQ(0, chdir(dir_s2d2)); in test_relative_path()
1866 ASSERT_EQ(0, chdir(dir_s1d2)); in test_relative_path()
1882 ASSERT_EQ(0, chdir(dir_s1d2)); in test_relative_path()
1887 ASSERT_EQ(0, chroot("../../s1d1/s1d2")) in test_relative_path()
1895 ASSERT_EQ(0, chroot(".")) in test_relative_path()
1903 ASSERT_EQ((rel == REL_CHROOT_CHDIR) ? 0 : EACCES, in test_relative_path()
1905 ASSERT_EQ(0, test_open_rel(dirfd, ".", O_RDONLY)); in test_relative_path()
1909 ASSERT_EQ(0, test_open_rel(dirfd, "./s2d3", O_RDONLY)); in test_relative_path()
1912 ASSERT_EQ(0, test_open_rel(dirfd, "./s1d3", O_RDONLY)); in test_relative_path()
1917 ASSERT_EQ(0, test_open_rel(dirfd, "/..", O_RDONLY)); in test_relative_path()
1918 ASSERT_EQ(0, test_open_rel(dirfd, "/", O_RDONLY)); in test_relative_path()
1919 ASSERT_EQ(0, test_open_rel(dirfd, "/f1", O_RDONLY)); in test_relative_path()
1920 ASSERT_EQ(0, test_open_rel(dirfd, "/s1d3", O_RDONLY)); in test_relative_path()
1924 ASSERT_EQ(EACCES, test_open_rel(dirfd, "../../s1d1", O_RDONLY)); in test_relative_path()
1925 ASSERT_EQ(0, test_open_rel(dirfd, "../../s1d1/s1d2", O_RDONLY)); in test_relative_path()
1926 ASSERT_EQ(0, test_open_rel(dirfd, "../../s1d1/s1d2/s1d3", in test_relative_path()
1929 ASSERT_EQ(EACCES, test_open_rel(dirfd, "../../s2d1", O_RDONLY)); in test_relative_path()
1930 ASSERT_EQ(0, test_open_rel(dirfd, "../../s2d1/s2d2", O_RDONLY)); in test_relative_path()
1931 ASSERT_EQ(0, test_open_rel(dirfd, "../../s2d1/s2d2/s2d3", in test_relative_path()
1936 ASSERT_EQ(0, close(dirfd)); in test_relative_path()
1937 ASSERT_EQ(0, close(ruleset_fd)); in test_relative_path()
1977 ASSERT_EQ(0, fstat(src_fd, &statbuf)); in copy_binary()
1978 ASSERT_EQ(statbuf.st_size, in copy_binary()
1980 ASSERT_EQ(0, close(src_fd)); in copy_binary()
1981 ASSERT_EQ(0, close(dst_fd)); in copy_binary()
1993 ASSERT_EQ(err ? -1 : 0, execve(path, argv, NULL)) in test_execute()
1998 ASSERT_EQ(err, errno); in test_execute()
2002 ASSERT_EQ(child, waitpid(child, &status, 0)); in test_execute()
2003 ASSERT_EQ(1, WIFEXITED(status)); in test_execute()
2004 ASSERT_EQ(err ? 2 : 0, WEXITSTATUS(status)) in test_execute()
2029 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
2031 ASSERT_EQ(0, test_open(dir_s1d1, O_RDONLY)); in TEST_F_FORK()
2032 ASSERT_EQ(0, test_open(file1_s1d1, O_RDONLY)); in TEST_F_FORK()
2035 ASSERT_EQ(0, test_open(dir_s1d2, O_RDONLY)); in TEST_F_FORK()
2036 ASSERT_EQ(0, test_open(file1_s1d2, O_RDONLY)); in TEST_F_FORK()
2039 ASSERT_EQ(0, test_open(dir_s1d3, O_RDONLY)); in TEST_F_FORK()
2040 ASSERT_EQ(0, test_open(file1_s1d3, O_RDONLY)); in TEST_F_FORK()
2064 ASSERT_EQ(0, unlink(file1_s1d1)); in TEST_F_FORK()
2065 ASSERT_EQ(0, unlink(file1_s1d2)); in TEST_F_FORK()
2066 ASSERT_EQ(0, unlink(file1_s1d3)); in TEST_F_FORK()
2069 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
2071 ASSERT_EQ(-1, link(file2_s1d1, file1_s1d1)); in TEST_F_FORK()
2072 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
2075 ASSERT_EQ(-1, link(file1_s2d1, file1_s1d2)); in TEST_F_FORK()
2076 ASSERT_EQ(EXDEV, errno); in TEST_F_FORK()
2077 ASSERT_EQ(-1, link(file2_s1d2, file1_s1d3)); in TEST_F_FORK()
2078 ASSERT_EQ(EXDEV, errno); in TEST_F_FORK()
2079 ASSERT_EQ(-1, link(file2_s1d3, file1_s1d2)); in TEST_F_FORK()
2080 ASSERT_EQ(EXDEV, errno); in TEST_F_FORK()
2082 ASSERT_EQ(0, link(file2_s1d2, file1_s1d2)); in TEST_F_FORK()
2083 ASSERT_EQ(0, link(file2_s1d3, file1_s1d3)); in TEST_F_FORK()
2086 ASSERT_EQ(0, unlink(file2_s1d2)); in TEST_F_FORK()
2087 ASSERT_EQ(0, unlink(file2_s1d3)); in TEST_F_FORK()
2092 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
2095 ASSERT_EQ(0, link(file1_s1d2, file2_s1d2)); in TEST_F_FORK()
2096 ASSERT_EQ(0, link(file1_s1d3, file2_s1d3)); in TEST_F_FORK()
2131 ASSERT_EQ(0, unlink(file1_s1d2)); in TEST_F_FORK()
2134 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
2140 ASSERT_EQ(-1, rename(file1_s2d3, file1_s1d3)); in TEST_F_FORK()
2141 ASSERT_EQ(EXDEV, errno); in TEST_F_FORK()
2142 ASSERT_EQ(-1, renameat2(AT_FDCWD, file1_s2d3, AT_FDCWD, file1_s1d3, in TEST_F_FORK()
2144 ASSERT_EQ(EXDEV, errno); in TEST_F_FORK()
2145 ASSERT_EQ(-1, renameat2(AT_FDCWD, file1_s2d3, AT_FDCWD, dir_s1d3, in TEST_F_FORK()
2147 ASSERT_EQ(EXDEV, errno); in TEST_F_FORK()
2153 ASSERT_EQ(-1, rename(file1_s2d1, file1_s1d3)); in TEST_F_FORK()
2154 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
2155 ASSERT_EQ(-1, renameat2(AT_FDCWD, file1_s2d1, AT_FDCWD, file1_s1d3, in TEST_F_FORK()
2157 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
2158 ASSERT_EQ(-1, renameat2(AT_FDCWD, dir_s2d2, AT_FDCWD, file1_s1d3, in TEST_F_FORK()
2160 ASSERT_EQ(EXDEV, errno); in TEST_F_FORK()
2163 ASSERT_EQ(-1, renameat2(AT_FDCWD, dir_s2d2, AT_FDCWD, file1_s2d1, in TEST_F_FORK()
2165 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
2167 ASSERT_EQ(-1, rename(dir_s2d2, file1_s2d1)); in TEST_F_FORK()
2168 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
2169 ASSERT_EQ(-1, renameat2(AT_FDCWD, file1_s2d1, AT_FDCWD, dir_s2d2, in TEST_F_FORK()
2171 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
2173 ASSERT_EQ(-1, rename(file1_s1d1, dir_s1d2)); in TEST_F_FORK()
2174 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
2177 ASSERT_EQ(-1, rename(file1_s2d2, file1_s1d2)); in TEST_F_FORK()
2178 ASSERT_EQ(EXDEV, errno); in TEST_F_FORK()
2179 ASSERT_EQ(0, unlink(file1_s1d3)); in TEST_F_FORK()
2180 ASSERT_EQ(-1, rename(file1_s2d1, file1_s1d3)); in TEST_F_FORK()
2181 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
2184 ASSERT_EQ(0, renameat2(AT_FDCWD, file2_s2d3, AT_FDCWD, file1_s2d3, in TEST_F_FORK()
2186 ASSERT_EQ(0, rename(file2_s2d3, file1_s2d3)); in TEST_F_FORK()
2189 ASSERT_EQ(0, renameat2(AT_FDCWD, file1_s2d2, AT_FDCWD, dir_s2d3, in TEST_F_FORK()
2191 ASSERT_EQ(0, renameat2(AT_FDCWD, file1_s2d2, AT_FDCWD, dir_s2d3, in TEST_F_FORK()
2214 ASSERT_EQ(0, unlink(file1_s1d3)); in TEST_F_FORK()
2215 ASSERT_EQ(0, unlink(file2_s1d3)); in TEST_F_FORK()
2218 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
2221 ASSERT_EQ(-1, renameat2(AT_FDCWD, dir_s2d3, AT_FDCWD, dir_s1d3, in TEST_F_FORK()
2223 ASSERT_EQ(EXDEV, errno); in TEST_F_FORK()
2224 ASSERT_EQ(-1, rename(dir_s2d3, dir_s1d3)); in TEST_F_FORK()
2225 ASSERT_EQ(EXDEV, errno); in TEST_F_FORK()
2226 ASSERT_EQ(-1, renameat2(AT_FDCWD, file1_s2d2, AT_FDCWD, dir_s1d3, in TEST_F_FORK()
2228 ASSERT_EQ(EXDEV, errno); in TEST_F_FORK()
2234 ASSERT_EQ(-1, renameat2(AT_FDCWD, dir_s1d1, AT_FDCWD, dir_s2d1, in TEST_F_FORK()
2236 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
2238 ASSERT_EQ(-1, rename(dir_s1d2, file1_s1d1)); in TEST_F_FORK()
2239 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
2240 ASSERT_EQ(-1, renameat2(AT_FDCWD, file1_s1d1, AT_FDCWD, dir_s1d2, in TEST_F_FORK()
2242 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
2244 ASSERT_EQ(-1, rename(file1_s1d1, dir_s1d2)); in TEST_F_FORK()
2245 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
2251 ASSERT_EQ(0, renameat2(AT_FDCWD, dir_s1d3, AT_FDCWD, file1_s1d2, in TEST_F_FORK()
2253 ASSERT_EQ(0, unlink(dir_s1d3)); in TEST_F_FORK()
2254 ASSERT_EQ(0, mkdir(dir_s1d3, 0700)); in TEST_F_FORK()
2255 ASSERT_EQ(0, rename(file1_s1d2, dir_s1d3)); in TEST_F_FORK()
2256 ASSERT_EQ(0, rmdir(dir_s1d3)); in TEST_F_FORK()
2277 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
2279 ASSERT_EQ(-1, rename(dir_s1d2, dir_s2d1)); in TEST_F_FORK()
2280 ASSERT_EQ(EXDEV, errno); in TEST_F_FORK()
2281 ASSERT_EQ(-1, rename(dir_s1d2, dir_s2d2)); in TEST_F_FORK()
2282 ASSERT_EQ(EXDEV, errno); in TEST_F_FORK()
2283 ASSERT_EQ(-1, rename(dir_s1d2, dir_s2d3)); in TEST_F_FORK()
2284 ASSERT_EQ(EXDEV, errno); in TEST_F_FORK()
2286 ASSERT_EQ(-1, rename(dir_s1d3, dir_s2d1)); in TEST_F_FORK()
2287 ASSERT_EQ(EXDEV, errno); in TEST_F_FORK()
2288 ASSERT_EQ(-1, rename(dir_s1d3, dir_s2d2)); in TEST_F_FORK()
2289 ASSERT_EQ(EXDEV, errno); in TEST_F_FORK()
2294 ASSERT_EQ(-1, rename(dir_s1d3, dir_s2d3)); in TEST_F_FORK()
2295 ASSERT_EQ(ENOTEMPTY, errno); in TEST_F_FORK()
2296 ASSERT_EQ(0, unlink(file1_s2d3)); in TEST_F_FORK()
2297 ASSERT_EQ(0, unlink(file2_s2d3)); in TEST_F_FORK()
2298 ASSERT_EQ(0, rename(dir_s1d3, dir_s2d3)); in TEST_F_FORK()
2309 ASSERT_EQ(0, unlink(file1_s1d2)); in refer_denied_by_default()
2314 ASSERT_EQ(0, close(ruleset_fd)); in refer_denied_by_default()
2320 ASSERT_EQ(layer1_err, test_rename(file1_s1d1, file1_s1d2)); in refer_denied_by_default()
2322 ASSERT_EQ(layer1_err, test_rename(file1_s1d2, file1_s1d1)); in refer_denied_by_default()
2323 ASSERT_EQ(layer1_err, test_exchange(file2_s1d1, file2_s1d2)); in refer_denied_by_default()
2324 ASSERT_EQ(layer1_err, test_exchange(file2_s1d2, file2_s1d1)); in refer_denied_by_default()
2329 ASSERT_EQ(0, close(ruleset_fd)); in refer_denied_by_default()
2337 ASSERT_EQ(EXDEV, test_rename(file1_s1d1, file1_s1d2)); in refer_denied_by_default()
2338 ASSERT_EQ(EXDEV, test_exchange(file2_s1d1, file2_s1d2)); in refer_denied_by_default()
2339 ASSERT_EQ(EXDEV, test_exchange(file2_s1d2, file2_s1d1)); in refer_denied_by_default()
2432 ASSERT_EQ(0, prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0)); in TEST_F_FORK()
2433 ASSERT_EQ(0, landlock_restrict_self(ruleset_fd, 0)); in TEST_F_FORK()
2474 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
2476 ASSERT_EQ(0, unlink(file1_s1d1)); in TEST_F_FORK()
2477 ASSERT_EQ(0, unlink(file1_s1d2)); in TEST_F_FORK()
2478 ASSERT_EQ(0, unlink(file1_s1d3)); in TEST_F_FORK()
2481 ASSERT_EQ(-1, link(file2_s1d1, file1_s1d1)); in TEST_F_FORK()
2482 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
2484 ASSERT_EQ(-1, link(file1_s2d1, file1_s1d2)); in TEST_F_FORK()
2485 ASSERT_EQ(EXDEV, errno); in TEST_F_FORK()
2487 ASSERT_EQ(-1, link(file1_s2d1, file1_s1d3)); in TEST_F_FORK()
2488 ASSERT_EQ(EXDEV, errno); in TEST_F_FORK()
2491 ASSERT_EQ(-1, link(file1_s2d2, file1_s1d1)); in TEST_F_FORK()
2492 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
2494 ASSERT_EQ(-1, link(file1_s2d2, file1_s1d2)); in TEST_F_FORK()
2495 ASSERT_EQ(EXDEV, errno); in TEST_F_FORK()
2498 ASSERT_EQ(0, link(file1_s2d2, file1_s1d3)); in TEST_F_FORK()
2499 ASSERT_EQ(0, unlink(file1_s2d2)); in TEST_F_FORK()
2501 ASSERT_EQ(-1, link(file1_s1d3, file1_s2d2)); in TEST_F_FORK()
2502 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
2503 ASSERT_EQ(0, unlink(file1_s2d3)); in TEST_F_FORK()
2505 ASSERT_EQ(0, link(file1_s1d3, file1_s2d3)); in TEST_F_FORK()
2506 ASSERT_EQ(0, unlink(file1_s1d3)); in TEST_F_FORK()
2512 ASSERT_EQ(0, link(file1_s2d3, file1_s1d3)); in TEST_F_FORK()
2513 ASSERT_EQ(0, unlink(file1_s1d3)); in TEST_F_FORK()
2515 ASSERT_EQ(-1, link(file2_s1d2, file1_s1d3)); in TEST_F_FORK()
2516 ASSERT_EQ(EXDEV, errno); in TEST_F_FORK()
2517 ASSERT_EQ(-1, link(file2_s1d3, file1_s1d2)); in TEST_F_FORK()
2518 ASSERT_EQ(EXDEV, errno); in TEST_F_FORK()
2520 ASSERT_EQ(0, link(file2_s1d2, file1_s1d2)); in TEST_F_FORK()
2521 ASSERT_EQ(0, link(file2_s1d3, file1_s1d3)); in TEST_F_FORK()
2552 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
2554 ASSERT_EQ(0, unlink(file1_s1d2)); in TEST_F_FORK()
2555 ASSERT_EQ(0, unlink(file1_s1d3)); in TEST_F_FORK()
2558 ASSERT_EQ(-1, renameat2(AT_FDCWD, file2_s1d1, AT_FDCWD, file1_s1d1, in TEST_F_FORK()
2560 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
2561 ASSERT_EQ(-1, renameat2(AT_FDCWD, file1_s1d1, AT_FDCWD, file2_s1d1, in TEST_F_FORK()
2563 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
2564 ASSERT_EQ(0, unlink(file1_s1d1)); in TEST_F_FORK()
2565 ASSERT_EQ(-1, rename(file2_s1d1, file1_s1d1)); in TEST_F_FORK()
2566 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
2568 ASSERT_EQ(-1, renameat2(AT_FDCWD, file2_s1d1, AT_FDCWD, file2_s1d1, in TEST_F_FORK()
2570 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
2573 ASSERT_EQ(-1, rename(file1_s2d1, file1_s1d2)); in TEST_F_FORK()
2574 ASSERT_EQ(EXDEV, errno); in TEST_F_FORK()
2579 ASSERT_EQ(-1, renameat2(AT_FDCWD, file1_s2d1, AT_FDCWD, file2_s1d1, in TEST_F_FORK()
2581 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
2582 ASSERT_EQ(-1, renameat2(AT_FDCWD, file2_s1d1, AT_FDCWD, file1_s2d1, in TEST_F_FORK()
2584 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
2587 ASSERT_EQ(-1, rename(file1_s2d1, file1_s1d3)); in TEST_F_FORK()
2588 ASSERT_EQ(EXDEV, errno); in TEST_F_FORK()
2590 ASSERT_EQ(-1, renameat2(AT_FDCWD, file1_s2d1, AT_FDCWD, file2_s1d3, in TEST_F_FORK()
2592 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
2595 ASSERT_EQ(-1, rename(file1_s2d2, file1_s1d1)); in TEST_F_FORK()
2596 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
2598 ASSERT_EQ(-1, rename(file1_s2d2, file1_s1d2)); in TEST_F_FORK()
2599 ASSERT_EQ(EXDEV, errno); in TEST_F_FORK()
2602 ASSERT_EQ(-1, renameat2(AT_FDCWD, file1_s2d2, AT_FDCWD, file2_s1d3, in TEST_F_FORK()
2604 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
2606 ASSERT_EQ(0, rename(file1_s2d2, file1_s1d3)); in TEST_F_FORK()
2609 ASSERT_EQ(-1, rename(file1_s1d3, file1_s2d2)); in TEST_F_FORK()
2610 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
2611 ASSERT_EQ(0, unlink(file1_s2d3)); in TEST_F_FORK()
2612 ASSERT_EQ(0, rename(file1_s1d3, file1_s2d3)); in TEST_F_FORK()
2615 ASSERT_EQ(0, rename(file1_s2d3, file1_s1d3)); in TEST_F_FORK()
2616 ASSERT_EQ(0, renameat2(AT_FDCWD, file2_s2d3, AT_FDCWD, file1_s1d3, in TEST_F_FORK()
2618 ASSERT_EQ(0, rename(file1_s1d3, file1_s2d3)); in TEST_F_FORK()
2624 ASSERT_EQ(0, rename(file1_s2d3, file1_s1d3)); in TEST_F_FORK()
2625 ASSERT_EQ(0, rename(file1_s1d3, file1_s2d3)); in TEST_F_FORK()
2634 ASSERT_EQ(0, rename(dir_s2d3, file1_s1d3)); in TEST_F_FORK()
2635 ASSERT_EQ(0, rename(file1_s1d3, dir_s2d3)); in TEST_F_FORK()
2640 ASSERT_EQ(-1, renameat2(AT_FDCWD, file1_s2d3, AT_FDCWD, dir_s1d3, in TEST_F_FORK()
2642 ASSERT_EQ(EXDEV, errno); in TEST_F_FORK()
2643 ASSERT_EQ(-1, renameat2(AT_FDCWD, dir_s1d3, AT_FDCWD, file1_s2d3, in TEST_F_FORK()
2645 ASSERT_EQ(EXDEV, errno); in TEST_F_FORK()
2646 ASSERT_EQ(-1, rename(file1_s2d3, dir_s1d3)); in TEST_F_FORK()
2647 ASSERT_EQ(EXDEV, errno); in TEST_F_FORK()
2649 ASSERT_EQ(-1, rename(file2_s1d2, file1_s1d3)); in TEST_F_FORK()
2650 ASSERT_EQ(EXDEV, errno); in TEST_F_FORK()
2651 ASSERT_EQ(-1, rename(file2_s1d3, file1_s1d2)); in TEST_F_FORK()
2652 ASSERT_EQ(EXDEV, errno); in TEST_F_FORK()
2655 ASSERT_EQ(0, rename(file2_s1d2, file1_s1d2)); in TEST_F_FORK()
2656 ASSERT_EQ(0, rename(file2_s1d3, file1_s1d3)); in TEST_F_FORK()
2658 ASSERT_EQ(0, unlink(file1_s1d2)); in TEST_F_FORK()
2660 ASSERT_EQ(-1, rename(dir_s2d3, file1_s1d2)); in TEST_F_FORK()
2661 ASSERT_EQ(EXDEV, errno); in TEST_F_FORK()
2663 ASSERT_EQ(0, unlink(file1_s1d3)); in TEST_F_FORK()
2665 ASSERT_EQ(-1, rename(dir_s2d2, file1_s1d3)); in TEST_F_FORK()
2666 ASSERT_EQ(EXDEV, errno); in TEST_F_FORK()
2698 ASSERT_EQ(0, close(ruleset_fd)); in reparent_exdev_layers_enforce1()
2720 ASSERT_EQ(0, close(ruleset_fd)); in reparent_exdev_layers_enforce2()
2725 ASSERT_EQ(0, unlink(file1_s2d2)); in TEST_F_FORK()
2726 ASSERT_EQ(0, unlink(file1_s2d3)); in TEST_F_FORK()
2734 ASSERT_EQ(0, rename(dir_s1d3, file1_s2d2)); in TEST_F_FORK()
2735 ASSERT_EQ(0, rename(file1_s2d2, dir_s1d3)); in TEST_F_FORK()
2742 ASSERT_EQ(0, rename(dir_s1d3, file1_s2d3)); in TEST_F_FORK()
2743 ASSERT_EQ(0, rename(file1_s2d3, dir_s1d3)); in TEST_F_FORK()
2750 ASSERT_EQ(0, rename(file1_s1d3, file1_s2d3)); in TEST_F_FORK()
2758 ASSERT_EQ(-1, rename(dir_s1d3, file1_s2d2)); in TEST_F_FORK()
2759 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
2765 ASSERT_EQ(-1, rename(dir_s1d3, file1_s2d3)); in TEST_F_FORK()
2766 ASSERT_EQ(EXDEV, errno); in TEST_F_FORK()
2773 ASSERT_EQ(-1, rename(file2_s1d3, file1_s2d3)); in TEST_F_FORK()
2774 ASSERT_EQ(EXDEV, errno); in TEST_F_FORK()
2782 ASSERT_EQ(-1, rename(file1_s1d1, file1_s2d2)); in TEST_F_FORK()
2783 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
2784 ASSERT_EQ(-1, rename(file1_s1d2, file1_s2d2)); in TEST_F_FORK()
2785 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
2786 ASSERT_EQ(-1, rename(file1_s1d1, file1_s2d3)); in TEST_F_FORK()
2787 ASSERT_EQ(EXDEV, errno); in TEST_F_FORK()
2789 ASSERT_EQ(0, rename(file1_s1d2, file1_s2d3)); in TEST_F_FORK()
2792 ASSERT_EQ(-1, rename(dir_s1d1, file1_s2d2)); in TEST_F_FORK()
2793 ASSERT_EQ(EXDEV, errno); in TEST_F_FORK()
2794 ASSERT_EQ(-1, rename(dir_s1d2, file1_s2d2)); in TEST_F_FORK()
2795 ASSERT_EQ(EXDEV, errno); in TEST_F_FORK()
2800 ASSERT_EQ(-1, rename(file1_s1d1, file1_s2d2)); in TEST_F_FORK()
2801 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
2803 ASSERT_EQ(-1, rename(file2_s1d2, file1_s2d2)); in TEST_F_FORK()
2804 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
2805 ASSERT_EQ(-1, rename(file1_s1d1, file1_s2d3)); in TEST_F_FORK()
2806 ASSERT_EQ(EXDEV, errno); in TEST_F_FORK()
2811 ASSERT_EQ(-1, rename(file2_s1d2, file1_s2d3)); in TEST_F_FORK()
2812 ASSERT_EQ(EXDEV, errno); in TEST_F_FORK()
2815 ASSERT_EQ(-1, rename(dir_s1d1, file1_s2d2)); in TEST_F_FORK()
2816 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
2817 ASSERT_EQ(-1, rename(dir_s1d2, file1_s2d2)); in TEST_F_FORK()
2818 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
2826 ASSERT_EQ(0, unlink(file1_s1d2)); in TEST_F_FORK()
2827 ASSERT_EQ(0, mkdir(file1_s1d2, 0700)); in TEST_F_FORK()
2828 ASSERT_EQ(0, unlink(file2_s2d3)); in TEST_F_FORK()
2829 ASSERT_EQ(0, mkdir(file2_s2d3, 0700)); in TEST_F_FORK()
2834 ASSERT_EQ(-1, renameat2(AT_FDCWD, file1_s1d1, AT_FDCWD, file1_s2d3, in TEST_F_FORK()
2836 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
2837 ASSERT_EQ(-1, renameat2(AT_FDCWD, file1_s2d3, AT_FDCWD, file1_s1d1, in TEST_F_FORK()
2839 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
2845 ASSERT_EQ(-1, renameat2(AT_FDCWD, dir_file1_s1d2, AT_FDCWD, in TEST_F_FORK()
2847 ASSERT_EQ(EXDEV, errno); in TEST_F_FORK()
2848 ASSERT_EQ(-1, renameat2(AT_FDCWD, dir_file2_s2d3, AT_FDCWD, in TEST_F_FORK()
2850 ASSERT_EQ(EXDEV, errno); in TEST_F_FORK()
2853 ASSERT_EQ(0, renameat2(AT_FDCWD, dir_s1d3, AT_FDCWD, dir_s2d3, in TEST_F_FORK()
2855 ASSERT_EQ(0, renameat2(AT_FDCWD, dir_s2d3, AT_FDCWD, dir_s1d3, in TEST_F_FORK()
2859 ASSERT_EQ(0, renameat2(AT_FDCWD, dir_s2d3, AT_FDCWD, dir_file1_s1d2, in TEST_F_FORK()
2861 ASSERT_EQ(0, renameat2(AT_FDCWD, dir_file1_s1d2, AT_FDCWD, dir_s2d3, in TEST_F_FORK()
2874 ASSERT_EQ(0, renameat2(AT_FDCWD, file1_s2d2, AT_FDCWD, dir_file2_s2d3, in TEST_F_FORK()
2881 ASSERT_EQ(-1, renameat2(AT_FDCWD, dir_file2_s2d3, AT_FDCWD, file1_s2d2, in TEST_F_FORK()
2883 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
2884 ASSERT_EQ(-1, renameat2(AT_FDCWD, file1_s2d2, AT_FDCWD, dir_file2_s2d3, in TEST_F_FORK()
2886 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
2891 ASSERT_EQ(-1, renameat2(AT_FDCWD, file1_s1d1, AT_FDCWD, file1_s2d3, in TEST_F_FORK()
2893 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
2894 ASSERT_EQ(-1, renameat2(AT_FDCWD, file1_s2d3, AT_FDCWD, file1_s1d1, in TEST_F_FORK()
2896 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
2899 ASSERT_EQ(-1, renameat2(AT_FDCWD, dir_file1_s1d2, AT_FDCWD, in TEST_F_FORK()
2901 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
2902 ASSERT_EQ(-1, renameat2(AT_FDCWD, dir_file2_s2d3, AT_FDCWD, in TEST_F_FORK()
2904 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
2907 ASSERT_EQ(-1, renameat2(AT_FDCWD, dir_s1d3, AT_FDCWD, dir_s2d3, in TEST_F_FORK()
2910 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
2911 ASSERT_EQ(-1, renameat2(AT_FDCWD, dir_s2d3, AT_FDCWD, dir_s1d3, in TEST_F_FORK()
2913 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
2916 ASSERT_EQ(-1, renameat2(AT_FDCWD, dir_s2d3, AT_FDCWD, dir_file1_s1d2, in TEST_F_FORK()
2919 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
2920 ASSERT_EQ(-1, renameat2(AT_FDCWD, dir_file1_s1d2, AT_FDCWD, dir_s2d3, in TEST_F_FORK()
2922 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
2931 ASSERT_EQ(0, unlink(file2_s2d3)); in TEST_F_FORK()
2932 ASSERT_EQ(0, mkdir(file2_s2d3, 0700)); in TEST_F_FORK()
2938 ASSERT_EQ(-1, renameat2(AT_FDCWD, file1_s2d2, AT_FDCWD, dir_file2_s2d3, in TEST_F_FORK()
2940 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
2941 ASSERT_EQ(-1, renameat2(AT_FDCWD, dir_file2_s2d3, AT_FDCWD, file1_s2d2, in TEST_F_FORK()
2943 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
2950 ASSERT_EQ(0, unlink(file2_s2d3)); in TEST_F_FORK()
2951 ASSERT_EQ(0, mkdir(file2_s2d3, 0700)); in TEST_F_FORK()
2960 ASSERT_EQ(0, renameat2(AT_FDCWD, dir_file2_s2d3, AT_FDCWD, file1_s2d2, in TEST_F_FORK()
2962 ASSERT_EQ(-1, renameat2(AT_FDCWD, file1_s2d2, AT_FDCWD, dir_file2_s2d3, in TEST_F_FORK()
2964 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
2965 ASSERT_EQ(-1, renameat2(AT_FDCWD, dir_file2_s2d3, AT_FDCWD, file1_s2d2, in TEST_F_FORK()
2967 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
2997 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
3000 ASSERT_EQ(-1, rename(file1_s1d1, dir_s2d2)); in TEST_F_FORK()
3001 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
3002 ASSERT_EQ(-1, rename(dir_s2d2, file1_s1d1)); in TEST_F_FORK()
3003 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
3004 ASSERT_EQ(-1, renameat2(AT_FDCWD, file1_s1d1, AT_FDCWD, dir_s2d2, in TEST_F_FORK()
3006 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
3007 ASSERT_EQ(-1, renameat2(AT_FDCWD, file1_s1d1, AT_FDCWD, dir_s2d3, in TEST_F_FORK()
3009 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
3012 ASSERT_EQ(-1, rename(file1_s2d1, dir_s1d2)); in TEST_F_FORK()
3013 ASSERT_EQ(EISDIR, errno); in TEST_F_FORK()
3014 ASSERT_EQ(-1, rename(dir_s1d2, file1_s2d1)); in TEST_F_FORK()
3015 ASSERT_EQ(ENOTDIR, errno); in TEST_F_FORK()
3016 ASSERT_EQ(-1, rename(dir_s1d3, file1_s2d1)); in TEST_F_FORK()
3017 ASSERT_EQ(ENOTDIR, errno); in TEST_F_FORK()
3018 ASSERT_EQ(0, unlink(file1_s2d1)); in TEST_F_FORK()
3019 ASSERT_EQ(0, unlink(file1_s1d3)); in TEST_F_FORK()
3020 ASSERT_EQ(0, unlink(file2_s1d3)); in TEST_F_FORK()
3021 ASSERT_EQ(0, rename(dir_s1d3, file1_s2d1)); in TEST_F_FORK()
3024 ASSERT_EQ(0, mkdir(dir_s1d3, 0700)); in TEST_F_FORK()
3025 ASSERT_EQ(0, renameat2(AT_FDCWD, file1_s2d2, AT_FDCWD, dir_s1d3, in TEST_F_FORK()
3027 ASSERT_EQ(-1, renameat2(AT_FDCWD, file1_s2d2, AT_FDCWD, dir_s1d3, in TEST_F_FORK()
3029 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
3071 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
3073 ASSERT_EQ(-1, rename(file1_s1d2, file1_s2d1)); in TEST_F_FORK()
3074 ASSERT_EQ(EXDEV, errno); in TEST_F_FORK()
3079 ASSERT_EQ(-1, rename(file1_s1d2, file1_s2d3)); in TEST_F_FORK()
3080 ASSERT_EQ(EXDEV, errno); in TEST_F_FORK()
3086 ASSERT_EQ(0, rename(file1_s1d2, file1_s2d2)); in TEST_F_FORK()
3087 ASSERT_EQ(0, rename(file1_s2d2, file1_s1d2)); in TEST_F_FORK()
3089 ASSERT_EQ(-1, rename(dir_s1d3, file1_s2d1)); in TEST_F_FORK()
3090 ASSERT_EQ(EXDEV, errno); in TEST_F_FORK()
3095 ASSERT_EQ(-1, rename(dir_s1d3, file1_s2d3)); in TEST_F_FORK()
3096 ASSERT_EQ(EXDEV, errno); in TEST_F_FORK()
3102 ASSERT_EQ(0, rename(dir_s1d3, file1_s2d2)); in TEST_F_FORK()
3103 ASSERT_EQ(0, rename(file1_s2d2, dir_s1d3)); in TEST_F_FORK()
3111 ASSERT_EQ(0, rename(file1_s2d3, file2_s1d2)); in TEST_F_FORK()
3112 ASSERT_EQ(-1, rename(file2_s1d2, file1_s2d3)); in TEST_F_FORK()
3113 ASSERT_EQ(EXDEV, errno); in TEST_F_FORK()
3114 ASSERT_EQ(0, unlink(file2_s1d2)); in TEST_F_FORK()
3115 ASSERT_EQ(0, unlink(file2_s2d3)); in TEST_F_FORK()
3120 ASSERT_EQ(0, rename(dir_s2d3, file2_s1d2)); in TEST_F_FORK()
3121 ASSERT_EQ(-1, rename(file2_s1d2, dir_s2d3)); in TEST_F_FORK()
3122 ASSERT_EQ(EXDEV, errno); in TEST_F_FORK()
3139 ASSERT_EQ(0, unlink(file1_s1d1)); in TEST_F_FORK()
3140 ASSERT_EQ(0, unlink(file1_s1d2)); in TEST_F_FORK()
3141 ASSERT_EQ(0, unlink(file1_s1d3)); in TEST_F_FORK()
3142 ASSERT_EQ(0, unlink(file2_s1d3)); in TEST_F_FORK()
3145 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
3147 ASSERT_EQ(0, rmdir(dir_s1d3)); in TEST_F_FORK()
3148 ASSERT_EQ(0, mkdir(dir_s1d3, 0700)); in TEST_F_FORK()
3149 ASSERT_EQ(0, unlinkat(AT_FDCWD, dir_s1d3, AT_REMOVEDIR)); in TEST_F_FORK()
3152 ASSERT_EQ(-1, rmdir(dir_s1d2)); in TEST_F_FORK()
3153 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
3154 ASSERT_EQ(-1, unlinkat(AT_FDCWD, dir_s1d2, AT_REMOVEDIR)); in TEST_F_FORK()
3155 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
3156 ASSERT_EQ(-1, rmdir(dir_s1d1)); in TEST_F_FORK()
3157 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
3158 ASSERT_EQ(-1, unlinkat(AT_FDCWD, dir_s1d1, AT_REMOVEDIR)); in TEST_F_FORK()
3159 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
3176 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
3178 ASSERT_EQ(-1, unlink(file1_s1d1)); in TEST_F_FORK()
3179 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
3180 ASSERT_EQ(-1, unlinkat(AT_FDCWD, file1_s1d1, 0)); in TEST_F_FORK()
3181 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
3182 ASSERT_EQ(0, unlink(file1_s1d2)); in TEST_F_FORK()
3183 ASSERT_EQ(0, unlinkat(AT_FDCWD, file1_s1d3, 0)); in TEST_F_FORK()
3201 ASSERT_EQ(0, unlink(file1_s1d1)); in test_make_file()
3202 ASSERT_EQ(0, unlink(file2_s1d1)); in test_make_file()
3203 ASSERT_EQ(0, mknod(file2_s1d1, mode | 0400, dev)) in test_make_file()
3209 ASSERT_EQ(0, unlink(file1_s1d2)); in test_make_file()
3210 ASSERT_EQ(0, unlink(file2_s1d2)); in test_make_file()
3212 ASSERT_EQ(0, unlink(file1_s1d3)); in test_make_file()
3213 ASSERT_EQ(0, unlink(file2_s1d3)); in test_make_file()
3216 ASSERT_EQ(0, close(ruleset_fd)); in test_make_file()
3218 ASSERT_EQ(-1, mknod(file1_s1d1, mode | 0400, dev)); in test_make_file()
3219 ASSERT_EQ(EACCES, errno); in test_make_file()
3220 ASSERT_EQ(-1, link(file2_s1d1, file1_s1d1)); in test_make_file()
3221 ASSERT_EQ(EACCES, errno); in test_make_file()
3222 ASSERT_EQ(-1, rename(file2_s1d1, file1_s1d1)); in test_make_file()
3223 ASSERT_EQ(EACCES, errno); in test_make_file()
3225 ASSERT_EQ(0, mknod(file1_s1d2, mode | 0400, dev)) in test_make_file()
3230 ASSERT_EQ(0, link(file1_s1d2, file2_s1d2)); in test_make_file()
3231 ASSERT_EQ(0, unlink(file2_s1d2)); in test_make_file()
3232 ASSERT_EQ(0, rename(file1_s1d2, file2_s1d2)); in test_make_file()
3234 ASSERT_EQ(0, mknod(file1_s1d3, mode | 0400, dev)); in test_make_file()
3235 ASSERT_EQ(0, link(file1_s1d3, file2_s1d3)); in test_make_file()
3236 ASSERT_EQ(0, unlink(file2_s1d3)); in test_make_file()
3237 ASSERT_EQ(0, rename(file1_s1d3, file2_s1d3)); in test_make_file()
3290 ASSERT_EQ(0, unlink(file1_s1d1)); in TEST_F_FORK()
3291 ASSERT_EQ(0, unlink(file2_s1d1)); in TEST_F_FORK()
3292 ASSERT_EQ(0, symlink("none", file2_s1d1)); in TEST_F_FORK()
3294 ASSERT_EQ(0, unlink(file1_s1d2)); in TEST_F_FORK()
3295 ASSERT_EQ(0, unlink(file2_s1d2)); in TEST_F_FORK()
3297 ASSERT_EQ(0, unlink(file1_s1d3)); in TEST_F_FORK()
3298 ASSERT_EQ(0, unlink(file2_s1d3)); in TEST_F_FORK()
3301 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
3303 ASSERT_EQ(-1, symlink("none", file1_s1d1)); in TEST_F_FORK()
3304 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
3305 ASSERT_EQ(-1, link(file2_s1d1, file1_s1d1)); in TEST_F_FORK()
3306 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
3307 ASSERT_EQ(-1, rename(file2_s1d1, file1_s1d1)); in TEST_F_FORK()
3308 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
3310 ASSERT_EQ(0, symlink("none", file1_s1d2)); in TEST_F_FORK()
3311 ASSERT_EQ(0, link(file1_s1d2, file2_s1d2)); in TEST_F_FORK()
3312 ASSERT_EQ(0, unlink(file2_s1d2)); in TEST_F_FORK()
3313 ASSERT_EQ(0, rename(file1_s1d2, file2_s1d2)); in TEST_F_FORK()
3315 ASSERT_EQ(0, symlink("none", file1_s1d3)); in TEST_F_FORK()
3316 ASSERT_EQ(0, link(file1_s1d3, file2_s1d3)); in TEST_F_FORK()
3317 ASSERT_EQ(0, unlink(file2_s1d3)); in TEST_F_FORK()
3318 ASSERT_EQ(0, rename(file1_s1d3, file2_s1d3)); in TEST_F_FORK()
3335 ASSERT_EQ(0, unlink(file1_s1d1)); in TEST_F_FORK()
3336 ASSERT_EQ(0, unlink(file1_s1d2)); in TEST_F_FORK()
3337 ASSERT_EQ(0, unlink(file1_s1d3)); in TEST_F_FORK()
3340 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
3343 ASSERT_EQ(-1, mkdir(file1_s1d1, 0700)); in TEST_F_FORK()
3344 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
3345 ASSERT_EQ(0, mkdir(file1_s1d2, 0700)); in TEST_F_FORK()
3346 ASSERT_EQ(0, mkdir(file1_s1d3, 0700)); in TEST_F_FORK()
3378 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
3380 ASSERT_EQ(EACCES, test_open(file1_s1d2, O_RDWR)); in TEST_F_FORK()
3381 ASSERT_EQ(0, test_open(file1_s1d2, O_RDONLY)); in TEST_F_FORK()
3384 ASSERT_EQ(0, unlink(file1_s1d2)); in TEST_F_FORK()
3388 ASSERT_EQ(0, close(proc_fd)); in TEST_F_FORK()
3391 ASSERT_EQ(-1, proc_fd) in TEST_F_FORK()
3396 ASSERT_EQ(EACCES, errno); in TEST_F_FORK()
3398 ASSERT_EQ(0, close(reg_fd)); in TEST_F_FORK()
3420 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
3423 ASSERT_EQ(0, test_open(file1_s1d2, O_RDWR)); in TEST_F_FORK()
3424 ASSERT_EQ(EACCES, test_open(file1_s1d1, O_RDWR)); in TEST_F_FORK()
3427 ASSERT_EQ(0, pipe2(pipe_fds, O_CLOEXEC)); in TEST_F_FORK()
3428 ASSERT_EQ(1, write(pipe_fds[1], ".", 1)) in TEST_F_FORK()
3432 ASSERT_EQ(1, read(pipe_fds[0], &buf, 1)); in TEST_F_FORK()
3433 ASSERT_EQ('.', buf); in TEST_F_FORK()
3438 ASSERT_EQ(1, write(proc_fd, ".", 1)) in TEST_F_FORK()
3443 ASSERT_EQ(0, close(proc_fd)); in TEST_F_FORK()
3449 ASSERT_EQ(1, read(proc_fd, &buf, 1)) in TEST_F_FORK()
3454 ASSERT_EQ(0, close(proc_fd)); in TEST_F_FORK()
3456 ASSERT_EQ(0, close(pipe_fds[0])); in TEST_F_FORK()
3457 ASSERT_EQ(0, close(pipe_fds[1])); in TEST_F_FORK()
3519 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
3602 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
3648 ASSERT_EQ(0, unlink(file_in_dir_w)); in TEST_F_FORK()
3710 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
3719 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
3729 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
3737 ASSERT_EQ(0, close(fd_layer0)); in TEST_F_FORK()
3738 ASSERT_EQ(0, close(fd_layer1)); in TEST_F_FORK()
3739 ASSERT_EQ(0, close(fd_layer2)); in TEST_F_FORK()
3740 ASSERT_EQ(0, close(fd_layer3)); in TEST_F_FORK()
3827 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
3834 ASSERT_EQ(0, close(fd)); in TEST_F_FORK()
3843 ASSERT_EQ(0, socketpair(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0, in TEST_F_FORK()
3867 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
3870 ASSERT_EQ(variant->expected_open_result, (fd < 0 ? errno : 0)); in TEST_F_FORK()
3873 ASSERT_EQ(0, send_fd(socket_fds[0], fd)); in TEST_F_FORK()
3874 ASSERT_EQ(0, close(fd)); in TEST_F_FORK()
3877 ASSERT_EQ(0, close(socket_fds[0])); in TEST_F_FORK()
3889 ASSERT_EQ(0, close(fd)); in TEST_F_FORK()
3892 ASSERT_EQ(child, waitpid(child, &status, 0)); in TEST_F_FORK()
3893 ASSERT_EQ(1, WIFEXITED(status)); in TEST_F_FORK()
3894 ASSERT_EQ(EXIT_SUCCESS, WEXITSTATUS(status)); in TEST_F_FORK()
3896 ASSERT_EQ(0, close(socket_fds[0])); in TEST_F_FORK()
3897 ASSERT_EQ(0, close(socket_fds[1])); in TEST_F_FORK()
3934 ASSERT_EQ(0, close(fd)); in TEST()
3940 ASSERT_EQ(0, close(ruleset_fd)); in TEST()
3971 ASSERT_EQ(0, close(fd)); in TEST_F_FORK()
3977 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
3990 ASSERT_EQ(0, close(fd)); in TEST_F_FORK()
4013 ASSERT_EQ(0, close(0)); in ioctl_error()
4020 ASSERT_EQ(0, dup2(stdinbak_fd, 0)); in ioctl_error()
4021 ASSERT_EQ(0, close(stdinbak_fd)); in ioctl_error()
4060 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
4103 ASSERT_EQ(0, close(fd)); in TEST_F_FORK()
4119 ASSERT_EQ(0, unlink(path)); in TEST_F_FORK()
4120 ASSERT_EQ(0, mkfifo(path, 0600)); in TEST_F_FORK()
4126 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
4143 ASSERT_EQ(0, close(fd)); in TEST_F_FORK()
4144 ASSERT_EQ(0, unlink(path)); in TEST_F_FORK()
4146 ASSERT_EQ(child_pid, waitpid(child_pid, NULL, 0)); in TEST_F_FORK()
4164 ASSERT_EQ(0, unlink(path)); in TEST_F_FORK()
4169 ASSERT_EQ(0, bind(srv_fd, (struct sockaddr *)&srv_un, size)); in TEST_F_FORK()
4170 ASSERT_EQ(0, listen(srv_fd, 10 /* qlen */)); in TEST_F_FORK()
4176 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
4184 ASSERT_EQ(0, bind(cli_fd, (struct sockaddr *)&cli_un, size)); in TEST_F_FORK()
4191 ASSERT_EQ(0, connect(cli_fd, (struct sockaddr *)&cli_un, size)); in TEST_F_FORK()
4196 ASSERT_EQ(0, close(cli_fd)); in TEST_F_FORK()
4263 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
4279 ASSERT_EQ(0, close(file_fd)); in TEST_F_FORK()
4298 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
4324 ASSERT_EQ(0, close(dir_fd)); in TEST_F_FORK()
4343 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
4362 ASSERT_EQ(0, close(file_fd)); in TEST_F_FORK()
4376 ASSERT_EQ(0, mount(dir_s1d2, dir_s2d2, NULL, MS_BIND, NULL)); in FIXTURE_SETUP()
4420 ASSERT_EQ(0, test_open(dir_s1d1, O_RDONLY)); in TEST_F_FORK()
4421 ASSERT_EQ(0, test_open(file1_s1d1, O_RDONLY)); in TEST_F_FORK()
4422 ASSERT_EQ(0, test_open(dir_s1d2, O_RDONLY)); in TEST_F_FORK()
4423 ASSERT_EQ(0, test_open(file1_s1d2, O_RDONLY)); in TEST_F_FORK()
4424 ASSERT_EQ(0, test_open(dir_s1d3, O_RDONLY)); in TEST_F_FORK()
4425 ASSERT_EQ(0, test_open(file1_s1d3, O_RDONLY)); in TEST_F_FORK()
4427 ASSERT_EQ(0, test_open(dir_s2d1, O_RDONLY)); in TEST_F_FORK()
4428 ASSERT_EQ(0, test_open(file1_s2d1, O_RDONLY)); in TEST_F_FORK()
4429 ASSERT_EQ(0, test_open(dir_s2d2, O_RDONLY)); in TEST_F_FORK()
4430 ASSERT_EQ(0, test_open(file1_s2d2, O_RDONLY)); in TEST_F_FORK()
4431 ASSERT_EQ(ENOENT, test_open(dir_s2d3, O_RDONLY)); in TEST_F_FORK()
4432 ASSERT_EQ(ENOENT, test_open(file1_s2d3, O_RDONLY)); in TEST_F_FORK()
4434 ASSERT_EQ(0, test_open(bind_dir_s1d3, O_RDONLY)); in TEST_F_FORK()
4435 ASSERT_EQ(0, test_open(bind_file1_s1d3, O_RDONLY)); in TEST_F_FORK()
4437 ASSERT_EQ(0, test_open(dir_s3d1, O_RDONLY)); in TEST_F_FORK()
4495 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
4498 ASSERT_EQ(0, test_open(file1_s1d1, O_RDONLY)); in TEST_F_FORK()
4499 ASSERT_EQ(EACCES, test_open(file1_s1d1, O_WRONLY)); in TEST_F_FORK()
4500 ASSERT_EQ(0, test_open(dir_s1d1, O_RDONLY | O_DIRECTORY)); in TEST_F_FORK()
4502 ASSERT_EQ(0, test_open(file1_s1d2, O_RDONLY)); in TEST_F_FORK()
4503 ASSERT_EQ(EACCES, test_open(file1_s1d2, O_WRONLY)); in TEST_F_FORK()
4504 ASSERT_EQ(0, test_open(dir_s1d2, O_RDONLY | O_DIRECTORY)); in TEST_F_FORK()
4507 ASSERT_EQ(0, test_open(file1_s2d1, O_RDWR)); in TEST_F_FORK()
4508 ASSERT_EQ(0, test_open(dir_s2d1, O_RDONLY | O_DIRECTORY)); in TEST_F_FORK()
4510 ASSERT_EQ(0, test_open(file1_s2d2, O_RDWR)); in TEST_F_FORK()
4511 ASSERT_EQ(0, test_open(dir_s2d2, O_RDONLY | O_DIRECTORY)); in TEST_F_FORK()
4517 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
4520 ASSERT_EQ(EACCES, test_open(file1_s1d1, O_RDONLY)); in TEST_F_FORK()
4521 ASSERT_EQ(EACCES, test_open(file1_s1d1, O_WRONLY)); in TEST_F_FORK()
4522 ASSERT_EQ(EACCES, test_open(dir_s1d1, O_RDONLY | O_DIRECTORY)); in TEST_F_FORK()
4524 ASSERT_EQ(0, test_open(file1_s1d2, O_RDONLY)); in TEST_F_FORK()
4525 ASSERT_EQ(EACCES, test_open(file1_s1d2, O_WRONLY)); in TEST_F_FORK()
4526 ASSERT_EQ(0, test_open(dir_s1d2, O_RDONLY | O_DIRECTORY)); in TEST_F_FORK()
4529 ASSERT_EQ(EACCES, test_open(file1_s2d1, O_RDONLY)); in TEST_F_FORK()
4530 ASSERT_EQ(EACCES, test_open(file1_s2d1, O_WRONLY)); in TEST_F_FORK()
4531 ASSERT_EQ(EACCES, test_open(dir_s2d1, O_RDONLY | O_DIRECTORY)); in TEST_F_FORK()
4533 ASSERT_EQ(0, test_open(file1_s2d2, O_RDWR)); in TEST_F_FORK()
4534 ASSERT_EQ(0, test_open(dir_s2d2, O_RDONLY | O_DIRECTORY)); in TEST_F_FORK()
4535 ASSERT_EQ(0, test_open(bind_dir_s1d3, O_RDONLY | O_DIRECTORY)); in TEST_F_FORK()
4541 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
4544 ASSERT_EQ(EACCES, test_open(file1_s1d2, O_RDONLY)); in TEST_F_FORK()
4545 ASSERT_EQ(EACCES, test_open(file1_s1d2, O_WRONLY)); in TEST_F_FORK()
4546 ASSERT_EQ(EACCES, test_open(dir_s1d2, O_RDONLY | O_DIRECTORY)); in TEST_F_FORK()
4548 ASSERT_EQ(0, test_open(file1_s1d3, O_RDONLY)); in TEST_F_FORK()
4549 ASSERT_EQ(EACCES, test_open(file1_s1d3, O_WRONLY)); in TEST_F_FORK()
4550 ASSERT_EQ(EACCES, test_open(dir_s1d3, O_RDONLY | O_DIRECTORY)); in TEST_F_FORK()
4553 ASSERT_EQ(EACCES, test_open(file1_s2d2, O_RDONLY)); in TEST_F_FORK()
4554 ASSERT_EQ(EACCES, test_open(file1_s2d2, O_WRONLY)); in TEST_F_FORK()
4555 ASSERT_EQ(EACCES, test_open(dir_s2d2, O_RDONLY | O_DIRECTORY)); in TEST_F_FORK()
4557 ASSERT_EQ(0, test_open(bind_file1_s1d3, O_RDONLY)); in TEST_F_FORK()
4558 ASSERT_EQ(EACCES, test_open(bind_file1_s1d3, O_WRONLY)); in TEST_F_FORK()
4559 ASSERT_EQ(EACCES, test_open(bind_dir_s1d3, O_RDONLY | O_DIRECTORY)); in TEST_F_FORK()
4565 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
4568 ASSERT_EQ(EACCES, test_open(file1_s1d3, O_RDONLY)); in TEST_F_FORK()
4569 ASSERT_EQ(EACCES, test_open(file1_s1d3, O_WRONLY)); in TEST_F_FORK()
4572 ASSERT_EQ(EACCES, test_open(bind_file1_s1d3, O_RDONLY)); in TEST_F_FORK()
4573 ASSERT_EQ(EACCES, test_open(bind_file1_s1d3, O_WRONLY)); in TEST_F_FORK()
4596 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
4599 ASSERT_EQ(-1, rename(file1_s1d1, file1_s1d2)); in TEST_F_FORK()
4600 ASSERT_EQ(EXDEV, errno); in TEST_F_FORK()
4603 ASSERT_EQ(-1, rename(file1_s2d1, file1_s2d2)); in TEST_F_FORK()
4604 ASSERT_EQ(EXDEV, errno); in TEST_F_FORK()
4607 ASSERT_EQ(-1, rename(file1_s2d2, bind_file1_s1d3)); in TEST_F_FORK()
4608 ASSERT_EQ(EXDEV, errno); in TEST_F_FORK()
4611 ASSERT_EQ(0, rename(bind_file1_s1d3, file1_s2d2)); in TEST_F_FORK()
4756 ASSERT_EQ(0, mount_opt(&mnt_tmp, LOWER_BASE)); in FIXTURE_SETUP()
4766 ASSERT_EQ(0, mount_opt(&mnt_tmp, UPPER_BASE)); in FIXTURE_SETUP()
4773 ASSERT_EQ(0, mkdir(UPPER_WORK, 0700)); in FIXTURE_SETUP()
4778 ASSERT_EQ(0, mount("overlay", MERGE_DATA, "overlay", 0, in FIXTURE_SETUP()
4820 ASSERT_EQ(0, test_open(lower_fl1, O_RDONLY)); in TEST_F_FORK()
4821 ASSERT_EQ(0, test_open(lower_dl1, O_RDONLY)); in TEST_F_FORK()
4822 ASSERT_EQ(0, test_open(lower_dl1_fl2, O_RDONLY)); in TEST_F_FORK()
4823 ASSERT_EQ(0, test_open(lower_fo1, O_RDONLY)); in TEST_F_FORK()
4824 ASSERT_EQ(0, test_open(lower_do1, O_RDONLY)); in TEST_F_FORK()
4825 ASSERT_EQ(0, test_open(lower_do1_fo2, O_RDONLY)); in TEST_F_FORK()
4826 ASSERT_EQ(0, test_open(lower_do1_fl3, O_RDONLY)); in TEST_F_FORK()
4828 ASSERT_EQ(0, test_open(upper_fu1, O_RDONLY)); in TEST_F_FORK()
4829 ASSERT_EQ(0, test_open(upper_du1, O_RDONLY)); in TEST_F_FORK()
4830 ASSERT_EQ(0, test_open(upper_du1_fu2, O_RDONLY)); in TEST_F_FORK()
4831 ASSERT_EQ(0, test_open(upper_fo1, O_RDONLY)); in TEST_F_FORK()
4832 ASSERT_EQ(0, test_open(upper_do1, O_RDONLY)); in TEST_F_FORK()
4833 ASSERT_EQ(0, test_open(upper_do1_fo2, O_RDONLY)); in TEST_F_FORK()
4834 ASSERT_EQ(0, test_open(upper_do1_fu3, O_RDONLY)); in TEST_F_FORK()
4836 ASSERT_EQ(0, test_open(merge_fl1, O_RDONLY)); in TEST_F_FORK()
4837 ASSERT_EQ(0, test_open(merge_dl1, O_RDONLY)); in TEST_F_FORK()
4838 ASSERT_EQ(0, test_open(merge_dl1_fl2, O_RDONLY)); in TEST_F_FORK()
4839 ASSERT_EQ(0, test_open(merge_fu1, O_RDONLY)); in TEST_F_FORK()
4840 ASSERT_EQ(0, test_open(merge_du1, O_RDONLY)); in TEST_F_FORK()
4841 ASSERT_EQ(0, test_open(merge_du1_fu2, O_RDONLY)); in TEST_F_FORK()
4842 ASSERT_EQ(0, test_open(merge_fo1, O_RDONLY)); in TEST_F_FORK()
4843 ASSERT_EQ(0, test_open(merge_do1, O_RDONLY)); in TEST_F_FORK()
4844 ASSERT_EQ(0, test_open(merge_do1_fo2, O_RDONLY)); in TEST_F_FORK()
4845 ASSERT_EQ(0, test_open(merge_do1_fl3, O_RDONLY)); in TEST_F_FORK()
4846 ASSERT_EQ(0, test_open(merge_do1_fu3, O_RDONLY)); in TEST_F_FORK()
4990 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
4994 ASSERT_EQ(0, test_open(path_entry, O_RDONLY)); in TEST_F_FORK()
4995 ASSERT_EQ(EACCES, test_open(path_entry, O_WRONLY)); in TEST_F_FORK()
4998 ASSERT_EQ(EACCES, in TEST_F_FORK()
5002 ASSERT_EQ(0, test_open(path_entry, O_RDONLY)); in TEST_F_FORK()
5003 ASSERT_EQ(EACCES, test_open(path_entry, O_WRONLY)); in TEST_F_FORK()
5007 ASSERT_EQ(0, test_open(path_entry, O_RDONLY)); in TEST_F_FORK()
5008 ASSERT_EQ(EACCES, test_open(path_entry, O_WRONLY)); in TEST_F_FORK()
5011 ASSERT_EQ(EACCES, in TEST_F_FORK()
5015 ASSERT_EQ(0, test_open(path_entry, O_RDONLY)); in TEST_F_FORK()
5016 ASSERT_EQ(EACCES, test_open(path_entry, O_WRONLY)); in TEST_F_FORK()
5025 ASSERT_EQ(0, test_open(path_entry, O_RDWR)); in TEST_F_FORK()
5028 ASSERT_EQ(0, test_open(path_entry, O_RDONLY | O_DIRECTORY)); in TEST_F_FORK()
5031 ASSERT_EQ(0, test_open(path_entry, O_RDWR)); in TEST_F_FORK()
5038 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
5042 ASSERT_EQ(0, test_open(path_entry, O_RDWR)); in TEST_F_FORK()
5045 ASSERT_EQ(0, test_open(path_entry, O_RDONLY | O_DIRECTORY)); in TEST_F_FORK()
5048 ASSERT_EQ(0, test_open(path_entry, O_RDWR)); in TEST_F_FORK()
5055 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
5059 ASSERT_EQ(EACCES, test_open(path_entry, O_RDONLY)); in TEST_F_FORK()
5063 ASSERT_EQ(EACCES, test_open(path_entry, O_RDONLY)); in TEST_F_FORK()
5067 ASSERT_EQ(EACCES, test_open(path_entry, O_RDWR)); in TEST_F_FORK()
5070 ASSERT_EQ(0, test_open(path_entry, O_RDONLY | O_DIRECTORY)); in TEST_F_FORK()
5073 ASSERT_EQ(0, test_open(path_entry, O_RDWR)); in TEST_F_FORK()
5080 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
5084 ASSERT_EQ(0, test_open(path_entry, O_RDONLY)); in TEST_F_FORK()
5085 ASSERT_EQ(EACCES, test_open(path_entry, O_WRONLY)); in TEST_F_FORK()
5089 ASSERT_EQ(0, test_open(path_entry, O_RDONLY)); in TEST_F_FORK()
5090 ASSERT_EQ(EACCES, test_open(path_entry, O_WRONLY)); in TEST_F_FORK()
5094 ASSERT_EQ(EACCES, test_open(path_entry, O_RDWR)); in TEST_F_FORK()
5097 ASSERT_EQ(EACCES, in TEST_F_FORK()
5101 ASSERT_EQ(0, test_open(path_entry, O_RDWR)); in TEST_F_FORK()
5108 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
5112 ASSERT_EQ(EACCES, test_open(path_entry, O_RDONLY)); in TEST_F_FORK()
5116 ASSERT_EQ(EACCES, test_open(path_entry, O_RDONLY)); in TEST_F_FORK()
5120 ASSERT_EQ(EACCES, test_open(path_entry, O_RDWR)); in TEST_F_FORK()
5123 ASSERT_EQ(EACCES, in TEST_F_FORK()
5127 ASSERT_EQ(0, test_open(path_entry, O_RDWR)); in TEST_F_FORK()
5388 ASSERT_EQ(0, umount(TMP_DIR)); in TEST_F_FORK()
5393 ASSERT_EQ(0, mount_opt(&mnt_tmp, TMP_DIR)); in TEST_F_FORK()
5397 ASSERT_EQ(0, close(ruleset_fd)); in TEST_F_FORK()
5400 ASSERT_EQ(EACCES, test_open(TMP_DIR, O_RDONLY)); in TEST_F_FORK()