Commit 135464f9 authored by Mickaël Salaün's avatar Mickaël Salaün

selftests/landlock: Normalize array assignment

Add a comma after each array value to make clang-format keep the
current array formatting.  See the following commit.

Automatically modified with:
sed -i 's/\t\({}\|NULL\)$/\0,/' tools/testing/selftests/landlock/fs_test.c

Link: https://lore.kernel.org/r/20220506160513.523257-5-mic@digikod.net
Cc: stable@vger.kernel.org
Signed-off-by: default avatarMickaël Salaün <mic@digikod.net>
parent 4598d9ab
...@@ -514,7 +514,7 @@ TEST_F_FORK(layout1, proc_nsfs) ...@@ -514,7 +514,7 @@ TEST_F_FORK(layout1, proc_nsfs)
.access = LANDLOCK_ACCESS_FS_READ_FILE | .access = LANDLOCK_ACCESS_FS_READ_FILE |
LANDLOCK_ACCESS_FS_WRITE_FILE, LANDLOCK_ACCESS_FS_WRITE_FILE,
}, },
{} {},
}; };
struct landlock_path_beneath_attr path_beneath; struct landlock_path_beneath_attr path_beneath;
const int ruleset_fd = create_ruleset(_metadata, rules[0].access | const int ruleset_fd = create_ruleset(_metadata, rules[0].access |
...@@ -560,7 +560,7 @@ TEST_F_FORK(layout1, unpriv) { ...@@ -560,7 +560,7 @@ TEST_F_FORK(layout1, unpriv) {
.path = dir_s1d2, .path = dir_s1d2,
.access = ACCESS_RO, .access = ACCESS_RO,
}, },
{} {},
}; };
int ruleset_fd; int ruleset_fd;
...@@ -588,7 +588,7 @@ TEST_F_FORK(layout1, effective_access) ...@@ -588,7 +588,7 @@ TEST_F_FORK(layout1, effective_access)
.access = LANDLOCK_ACCESS_FS_READ_FILE | .access = LANDLOCK_ACCESS_FS_READ_FILE |
LANDLOCK_ACCESS_FS_WRITE_FILE, LANDLOCK_ACCESS_FS_WRITE_FILE,
}, },
{} {},
}; };
const int ruleset_fd = create_ruleset(_metadata, ACCESS_RW, rules); const int ruleset_fd = create_ruleset(_metadata, ACCESS_RW, rules);
char buf; char buf;
...@@ -635,7 +635,7 @@ TEST_F_FORK(layout1, unhandled_access) ...@@ -635,7 +635,7 @@ TEST_F_FORK(layout1, unhandled_access)
.path = dir_s1d2, .path = dir_s1d2,
.access = ACCESS_RO, .access = ACCESS_RO,
}, },
{} {},
}; };
/* Here, we only handle read accesses, not write accesses. */ /* Here, we only handle read accesses, not write accesses. */
const int ruleset_fd = create_ruleset(_metadata, ACCESS_RO, rules); const int ruleset_fd = create_ruleset(_metadata, ACCESS_RO, rules);
...@@ -669,7 +669,7 @@ TEST_F_FORK(layout1, ruleset_overlap) ...@@ -669,7 +669,7 @@ TEST_F_FORK(layout1, ruleset_overlap)
.access = LANDLOCK_ACCESS_FS_READ_FILE | .access = LANDLOCK_ACCESS_FS_READ_FILE |
LANDLOCK_ACCESS_FS_READ_DIR, LANDLOCK_ACCESS_FS_READ_DIR,
}, },
{} {},
}; };
const int ruleset_fd = create_ruleset(_metadata, ACCESS_RW, rules); const int ruleset_fd = create_ruleset(_metadata, ACCESS_RW, rules);
...@@ -703,14 +703,14 @@ TEST_F_FORK(layout1, non_overlapping_accesses) ...@@ -703,14 +703,14 @@ TEST_F_FORK(layout1, non_overlapping_accesses)
.path = dir_s1d2, .path = dir_s1d2,
.access = LANDLOCK_ACCESS_FS_MAKE_REG, .access = LANDLOCK_ACCESS_FS_MAKE_REG,
}, },
{} {},
}; };
const struct rule layer2[] = { const struct rule layer2[] = {
{ {
.path = dir_s1d3, .path = dir_s1d3,
.access = LANDLOCK_ACCESS_FS_REMOVE_FILE, .access = LANDLOCK_ACCESS_FS_REMOVE_FILE,
}, },
{} {},
}; };
int ruleset_fd; int ruleset_fd;
...@@ -767,7 +767,7 @@ TEST_F_FORK(layout1, interleaved_masked_accesses) ...@@ -767,7 +767,7 @@ TEST_F_FORK(layout1, interleaved_masked_accesses)
.path = file1_s1d3, .path = file1_s1d3,
.access = LANDLOCK_ACCESS_FS_READ_FILE, .access = LANDLOCK_ACCESS_FS_READ_FILE,
}, },
{} {},
}; };
/* First rule with write restrictions. */ /* First rule with write restrictions. */
const struct rule layer2_read_write[] = { const struct rule layer2_read_write[] = {
...@@ -782,7 +782,7 @@ TEST_F_FORK(layout1, interleaved_masked_accesses) ...@@ -782,7 +782,7 @@ TEST_F_FORK(layout1, interleaved_masked_accesses)
.path = dir_s1d2, .path = dir_s1d2,
.access = LANDLOCK_ACCESS_FS_WRITE_FILE, .access = LANDLOCK_ACCESS_FS_WRITE_FILE,
}, },
{} {},
}; };
const struct rule layer3_read[] = { const struct rule layer3_read[] = {
/* Allows read access via its great-grandparent directory. */ /* Allows read access via its great-grandparent directory. */
...@@ -790,7 +790,7 @@ TEST_F_FORK(layout1, interleaved_masked_accesses) ...@@ -790,7 +790,7 @@ TEST_F_FORK(layout1, interleaved_masked_accesses)
.path = dir_s1d1, .path = dir_s1d1,
.access = LANDLOCK_ACCESS_FS_READ_FILE, .access = LANDLOCK_ACCESS_FS_READ_FILE,
}, },
{} {},
}; };
const struct rule layer4_read_write[] = { const struct rule layer4_read_write[] = {
/* /*
...@@ -801,7 +801,7 @@ TEST_F_FORK(layout1, interleaved_masked_accesses) ...@@ -801,7 +801,7 @@ TEST_F_FORK(layout1, interleaved_masked_accesses)
.path = dir_s1d2, .path = dir_s1d2,
.access = LANDLOCK_ACCESS_FS_READ_FILE, .access = LANDLOCK_ACCESS_FS_READ_FILE,
}, },
{} {},
}; };
const struct rule layer5_read[] = { const struct rule layer5_read[] = {
/* /*
...@@ -812,7 +812,7 @@ TEST_F_FORK(layout1, interleaved_masked_accesses) ...@@ -812,7 +812,7 @@ TEST_F_FORK(layout1, interleaved_masked_accesses)
.path = dir_s1d2, .path = dir_s1d2,
.access = LANDLOCK_ACCESS_FS_READ_FILE, .access = LANDLOCK_ACCESS_FS_READ_FILE,
}, },
{} {},
}; };
const struct rule layer6_execute[] = { const struct rule layer6_execute[] = {
/* /*
...@@ -823,7 +823,7 @@ TEST_F_FORK(layout1, interleaved_masked_accesses) ...@@ -823,7 +823,7 @@ TEST_F_FORK(layout1, interleaved_masked_accesses)
.path = dir_s2d1, .path = dir_s2d1,
.access = LANDLOCK_ACCESS_FS_EXECUTE, .access = LANDLOCK_ACCESS_FS_EXECUTE,
}, },
{} {},
}; };
const struct rule layer7_read_write[] = { const struct rule layer7_read_write[] = {
/* /*
...@@ -834,7 +834,7 @@ TEST_F_FORK(layout1, interleaved_masked_accesses) ...@@ -834,7 +834,7 @@ TEST_F_FORK(layout1, interleaved_masked_accesses)
.path = dir_s1d2, .path = dir_s1d2,
.access = LANDLOCK_ACCESS_FS_WRITE_FILE, .access = LANDLOCK_ACCESS_FS_WRITE_FILE,
}, },
{} {},
}; };
int ruleset_fd; int ruleset_fd;
...@@ -932,7 +932,7 @@ TEST_F_FORK(layout1, inherit_subset) ...@@ -932,7 +932,7 @@ TEST_F_FORK(layout1, inherit_subset)
.access = LANDLOCK_ACCESS_FS_READ_FILE | .access = LANDLOCK_ACCESS_FS_READ_FILE |
LANDLOCK_ACCESS_FS_READ_DIR, LANDLOCK_ACCESS_FS_READ_DIR,
}, },
{} {},
}; };
const int ruleset_fd = create_ruleset(_metadata, ACCESS_RW, rules); const int ruleset_fd = create_ruleset(_metadata, ACCESS_RW, rules);
...@@ -1048,7 +1048,7 @@ TEST_F_FORK(layout1, inherit_superset) ...@@ -1048,7 +1048,7 @@ TEST_F_FORK(layout1, inherit_superset)
.path = dir_s1d3, .path = dir_s1d3,
.access = ACCESS_RO, .access = ACCESS_RO,
}, },
{} {},
}; };
const int ruleset_fd = create_ruleset(_metadata, ACCESS_RW, rules); const int ruleset_fd = create_ruleset(_metadata, ACCESS_RW, rules);
...@@ -1084,7 +1084,7 @@ TEST_F_FORK(layout1, max_layers) ...@@ -1084,7 +1084,7 @@ TEST_F_FORK(layout1, max_layers)
.path = dir_s1d2, .path = dir_s1d2,
.access = ACCESS_RO, .access = ACCESS_RO,
}, },
{} {},
}; };
const int ruleset_fd = create_ruleset(_metadata, ACCESS_RW, rules); const int ruleset_fd = create_ruleset(_metadata, ACCESS_RW, rules);
...@@ -1146,7 +1146,7 @@ TEST_F_FORK(layout1, rule_on_mountpoint) ...@@ -1146,7 +1146,7 @@ TEST_F_FORK(layout1, rule_on_mountpoint)
.path = dir_s3d2, .path = dir_s3d2,
.access = ACCESS_RO, .access = ACCESS_RO,
}, },
{} {},
}; };
const int ruleset_fd = create_ruleset(_metadata, ACCESS_RW, rules); const int ruleset_fd = create_ruleset(_metadata, ACCESS_RW, rules);
...@@ -1175,7 +1175,7 @@ TEST_F_FORK(layout1, rule_over_mountpoint) ...@@ -1175,7 +1175,7 @@ TEST_F_FORK(layout1, rule_over_mountpoint)
.path = dir_s3d1, .path = dir_s3d1,
.access = ACCESS_RO, .access = ACCESS_RO,
}, },
{} {},
}; };
const int ruleset_fd = create_ruleset(_metadata, ACCESS_RW, rules); const int ruleset_fd = create_ruleset(_metadata, ACCESS_RW, rules);
...@@ -1203,7 +1203,7 @@ TEST_F_FORK(layout1, rule_over_root_allow_then_deny) ...@@ -1203,7 +1203,7 @@ TEST_F_FORK(layout1, rule_over_root_allow_then_deny)
.path = "/", .path = "/",
.access = ACCESS_RO, .access = ACCESS_RO,
}, },
{} {},
}; };
int ruleset_fd = create_ruleset(_metadata, ACCESS_RW, rules); int ruleset_fd = create_ruleset(_metadata, ACCESS_RW, rules);
...@@ -1233,7 +1233,7 @@ TEST_F_FORK(layout1, rule_over_root_deny) ...@@ -1233,7 +1233,7 @@ TEST_F_FORK(layout1, rule_over_root_deny)
.path = "/", .path = "/",
.access = LANDLOCK_ACCESS_FS_READ_FILE, .access = LANDLOCK_ACCESS_FS_READ_FILE,
}, },
{} {},
}; };
const int ruleset_fd = create_ruleset(_metadata, ACCESS_RW, rules); const int ruleset_fd = create_ruleset(_metadata, ACCESS_RW, rules);
...@@ -1253,7 +1253,7 @@ TEST_F_FORK(layout1, rule_inside_mount_ns) ...@@ -1253,7 +1253,7 @@ TEST_F_FORK(layout1, rule_inside_mount_ns)
.path = "s3d3", .path = "s3d3",
.access = ACCESS_RO, .access = ACCESS_RO,
}, },
{} {},
}; };
int ruleset_fd; int ruleset_fd;
...@@ -1280,7 +1280,7 @@ TEST_F_FORK(layout1, mount_and_pivot) ...@@ -1280,7 +1280,7 @@ TEST_F_FORK(layout1, mount_and_pivot)
.path = dir_s3d2, .path = dir_s3d2,
.access = ACCESS_RO, .access = ACCESS_RO,
}, },
{} {},
}; };
const int ruleset_fd = create_ruleset(_metadata, ACCESS_RW, rules); const int ruleset_fd = create_ruleset(_metadata, ACCESS_RW, rules);
...@@ -1303,7 +1303,7 @@ TEST_F_FORK(layout1, move_mount) ...@@ -1303,7 +1303,7 @@ TEST_F_FORK(layout1, move_mount)
.path = dir_s3d2, .path = dir_s3d2,
.access = ACCESS_RO, .access = ACCESS_RO,
}, },
{} {},
}; };
const int ruleset_fd = create_ruleset(_metadata, ACCESS_RW, rules); const int ruleset_fd = create_ruleset(_metadata, ACCESS_RW, rules);
...@@ -1344,7 +1344,7 @@ TEST_F_FORK(layout1, release_inodes) ...@@ -1344,7 +1344,7 @@ TEST_F_FORK(layout1, release_inodes)
.path = dir_s3d3, .path = dir_s3d3,
.access = ACCESS_RO, .access = ACCESS_RO,
}, },
{} {},
}; };
const int ruleset_fd = create_ruleset(_metadata, ACCESS_RW, rules); const int ruleset_fd = create_ruleset(_metadata, ACCESS_RW, rules);
...@@ -1382,7 +1382,7 @@ static void test_relative_path(struct __test_metadata *const _metadata, ...@@ -1382,7 +1382,7 @@ static void test_relative_path(struct __test_metadata *const _metadata,
.path = TMP_DIR, .path = TMP_DIR,
.access = ACCESS_RO, .access = ACCESS_RO,
}, },
{} {},
}; };
const struct rule layer2_subs[] = { const struct rule layer2_subs[] = {
{ {
...@@ -1393,7 +1393,7 @@ static void test_relative_path(struct __test_metadata *const _metadata, ...@@ -1393,7 +1393,7 @@ static void test_relative_path(struct __test_metadata *const _metadata,
.path = dir_s2d2, .path = dir_s2d2,
.access = ACCESS_RO, .access = ACCESS_RO,
}, },
{} {},
}; };
int dirfd, ruleset_fd; int dirfd, ruleset_fd;
...@@ -1558,7 +1558,7 @@ TEST_F_FORK(layout1, execute) ...@@ -1558,7 +1558,7 @@ TEST_F_FORK(layout1, execute)
.path = dir_s1d2, .path = dir_s1d2,
.access = LANDLOCK_ACCESS_FS_EXECUTE, .access = LANDLOCK_ACCESS_FS_EXECUTE,
}, },
{} {},
}; };
const int ruleset_fd = create_ruleset(_metadata, rules[0].access, const int ruleset_fd = create_ruleset(_metadata, rules[0].access,
rules); rules);
...@@ -1591,7 +1591,7 @@ TEST_F_FORK(layout1, link) ...@@ -1591,7 +1591,7 @@ TEST_F_FORK(layout1, link)
.path = dir_s1d2, .path = dir_s1d2,
.access = LANDLOCK_ACCESS_FS_MAKE_REG, .access = LANDLOCK_ACCESS_FS_MAKE_REG,
}, },
{} {},
}; };
const int ruleset_fd = create_ruleset(_metadata, rules[0].access, const int ruleset_fd = create_ruleset(_metadata, rules[0].access,
rules); rules);
...@@ -1628,7 +1628,7 @@ TEST_F_FORK(layout1, rename_file) ...@@ -1628,7 +1628,7 @@ TEST_F_FORK(layout1, rename_file)
.path = dir_s2d2, .path = dir_s2d2,
.access = LANDLOCK_ACCESS_FS_REMOVE_FILE, .access = LANDLOCK_ACCESS_FS_REMOVE_FILE,
}, },
{} {},
}; };
const int ruleset_fd = create_ruleset(_metadata, rules[0].access, const int ruleset_fd = create_ruleset(_metadata, rules[0].access,
rules); rules);
...@@ -1705,7 +1705,7 @@ TEST_F_FORK(layout1, rename_dir) ...@@ -1705,7 +1705,7 @@ TEST_F_FORK(layout1, rename_dir)
.path = dir_s2d1, .path = dir_s2d1,
.access = LANDLOCK_ACCESS_FS_REMOVE_DIR, .access = LANDLOCK_ACCESS_FS_REMOVE_DIR,
}, },
{} {},
}; };
const int ruleset_fd = create_ruleset(_metadata, rules[0].access, const int ruleset_fd = create_ruleset(_metadata, rules[0].access,
rules); rules);
...@@ -1759,7 +1759,7 @@ TEST_F_FORK(layout1, remove_dir) ...@@ -1759,7 +1759,7 @@ TEST_F_FORK(layout1, remove_dir)
.path = dir_s1d2, .path = dir_s1d2,
.access = LANDLOCK_ACCESS_FS_REMOVE_DIR, .access = LANDLOCK_ACCESS_FS_REMOVE_DIR,
}, },
{} {},
}; };
const int ruleset_fd = create_ruleset(_metadata, rules[0].access, const int ruleset_fd = create_ruleset(_metadata, rules[0].access,
rules); rules);
...@@ -1796,7 +1796,7 @@ TEST_F_FORK(layout1, remove_file) ...@@ -1796,7 +1796,7 @@ TEST_F_FORK(layout1, remove_file)
.path = dir_s1d2, .path = dir_s1d2,
.access = LANDLOCK_ACCESS_FS_REMOVE_FILE, .access = LANDLOCK_ACCESS_FS_REMOVE_FILE,
}, },
{} {},
}; };
const int ruleset_fd = create_ruleset(_metadata, rules[0].access, const int ruleset_fd = create_ruleset(_metadata, rules[0].access,
rules); rules);
...@@ -1821,7 +1821,7 @@ static void test_make_file(struct __test_metadata *const _metadata, ...@@ -1821,7 +1821,7 @@ static void test_make_file(struct __test_metadata *const _metadata,
.path = dir_s1d2, .path = dir_s1d2,
.access = access, .access = access,
}, },
{} {},
}; };
const int ruleset_fd = create_ruleset(_metadata, access, rules); const int ruleset_fd = create_ruleset(_metadata, access, rules);
...@@ -1907,7 +1907,7 @@ TEST_F_FORK(layout1, make_sym) ...@@ -1907,7 +1907,7 @@ TEST_F_FORK(layout1, make_sym)
.path = dir_s1d2, .path = dir_s1d2,
.access = LANDLOCK_ACCESS_FS_MAKE_SYM, .access = LANDLOCK_ACCESS_FS_MAKE_SYM,
}, },
{} {},
}; };
const int ruleset_fd = create_ruleset(_metadata, rules[0].access, const int ruleset_fd = create_ruleset(_metadata, rules[0].access,
rules); rules);
...@@ -1952,7 +1952,7 @@ TEST_F_FORK(layout1, make_dir) ...@@ -1952,7 +1952,7 @@ TEST_F_FORK(layout1, make_dir)
.path = dir_s1d2, .path = dir_s1d2,
.access = LANDLOCK_ACCESS_FS_MAKE_DIR, .access = LANDLOCK_ACCESS_FS_MAKE_DIR,
}, },
{} {},
}; };
const int ruleset_fd = create_ruleset(_metadata, rules[0].access, const int ruleset_fd = create_ruleset(_metadata, rules[0].access,
rules); rules);
...@@ -1992,7 +1992,7 @@ TEST_F_FORK(layout1, proc_unlinked_file) ...@@ -1992,7 +1992,7 @@ TEST_F_FORK(layout1, proc_unlinked_file)
.path = file1_s1d2, .path = file1_s1d2,
.access = LANDLOCK_ACCESS_FS_READ_FILE, .access = LANDLOCK_ACCESS_FS_READ_FILE,
}, },
{} {},
}; };
int reg_fd, proc_fd; int reg_fd, proc_fd;
const int ruleset_fd = create_ruleset(_metadata, const int ruleset_fd = create_ruleset(_metadata,
...@@ -2034,7 +2034,7 @@ TEST_F_FORK(layout1, proc_pipe) ...@@ -2034,7 +2034,7 @@ TEST_F_FORK(layout1, proc_pipe)
.access = LANDLOCK_ACCESS_FS_READ_FILE | .access = LANDLOCK_ACCESS_FS_READ_FILE |
LANDLOCK_ACCESS_FS_WRITE_FILE, LANDLOCK_ACCESS_FS_WRITE_FILE,
}, },
{} {},
}; };
/* Limits read and write access to files tied to the filesystem. */ /* Limits read and write access to files tied to the filesystem. */
const int ruleset_fd = create_ruleset(_metadata, rules[0].access, const int ruleset_fd = create_ruleset(_metadata, rules[0].access,
...@@ -2171,7 +2171,7 @@ TEST_F_FORK(layout1_bind, same_content_same_file) ...@@ -2171,7 +2171,7 @@ TEST_F_FORK(layout1_bind, same_content_same_file)
.path = dir_s2d1, .path = dir_s2d1,
.access = ACCESS_RW, .access = ACCESS_RW,
}, },
{} {},
}; };
/* /*
* Sets access rights on the same bind-mounted directories. The result * Sets access rights on the same bind-mounted directories. The result
...@@ -2187,7 +2187,7 @@ TEST_F_FORK(layout1_bind, same_content_same_file) ...@@ -2187,7 +2187,7 @@ TEST_F_FORK(layout1_bind, same_content_same_file)
.path = dir_s2d2, .path = dir_s2d2,
.access = ACCESS_RW, .access = ACCESS_RW,
}, },
{} {},
}; };
/* Only allow read-access to the s1d3 hierarchies. */ /* Only allow read-access to the s1d3 hierarchies. */
const struct rule layer3_source[] = { const struct rule layer3_source[] = {
...@@ -2195,7 +2195,7 @@ TEST_F_FORK(layout1_bind, same_content_same_file) ...@@ -2195,7 +2195,7 @@ TEST_F_FORK(layout1_bind, same_content_same_file)
.path = dir_s1d3, .path = dir_s1d3,
.access = LANDLOCK_ACCESS_FS_READ_FILE, .access = LANDLOCK_ACCESS_FS_READ_FILE,
}, },
{} {},
}; };
/* Removes all access rights. */ /* Removes all access rights. */
const struct rule layer4_destination[] = { const struct rule layer4_destination[] = {
...@@ -2203,7 +2203,7 @@ TEST_F_FORK(layout1_bind, same_content_same_file) ...@@ -2203,7 +2203,7 @@ TEST_F_FORK(layout1_bind, same_content_same_file)
.path = bind_file1_s1d3, .path = bind_file1_s1d3,
.access = LANDLOCK_ACCESS_FS_WRITE_FILE, .access = LANDLOCK_ACCESS_FS_WRITE_FILE,
}, },
{} {},
}; };
int ruleset_fd; int ruleset_fd;
...@@ -2305,18 +2305,18 @@ static const char lower_do1_fl3[] = LOWER_DATA "/do1/fl3"; ...@@ -2305,18 +2305,18 @@ static const char lower_do1_fl3[] = LOWER_DATA "/do1/fl3";
static const char (*lower_base_files[])[] = { static const char (*lower_base_files[])[] = {
&lower_fl1, &lower_fl1,
&lower_fo1, &lower_fo1,
NULL NULL,
}; };
static const char (*lower_base_directories[])[] = { static const char (*lower_base_directories[])[] = {
&lower_dl1, &lower_dl1,
&lower_do1, &lower_do1,
NULL NULL,
}; };
static const char (*lower_sub_files[])[] = { static const char (*lower_sub_files[])[] = {
&lower_dl1_fl2, &lower_dl1_fl2,
&lower_do1_fo2, &lower_do1_fo2,
&lower_do1_fl3, &lower_do1_fl3,
NULL NULL,
}; };
#define UPPER_BASE TMP_DIR "/upper" #define UPPER_BASE TMP_DIR "/upper"
...@@ -2333,18 +2333,18 @@ static const char upper_do1_fu3[] = UPPER_DATA "/do1/fu3"; ...@@ -2333,18 +2333,18 @@ static const char upper_do1_fu3[] = UPPER_DATA "/do1/fu3";
static const char (*upper_base_files[])[] = { static const char (*upper_base_files[])[] = {
&upper_fu1, &upper_fu1,
&upper_fo1, &upper_fo1,
NULL NULL,
}; };
static const char (*upper_base_directories[])[] = { static const char (*upper_base_directories[])[] = {
&upper_du1, &upper_du1,
&upper_do1, &upper_do1,
NULL NULL,
}; };
static const char (*upper_sub_files[])[] = { static const char (*upper_sub_files[])[] = {
&upper_du1_fu2, &upper_du1_fu2,
&upper_do1_fo2, &upper_do1_fo2,
&upper_do1_fu3, &upper_do1_fu3,
NULL NULL,
}; };
#define MERGE_BASE TMP_DIR "/merge" #define MERGE_BASE TMP_DIR "/merge"
...@@ -2365,13 +2365,13 @@ static const char (*merge_base_files[])[] = { ...@@ -2365,13 +2365,13 @@ static const char (*merge_base_files[])[] = {
&merge_fl1, &merge_fl1,
&merge_fu1, &merge_fu1,
&merge_fo1, &merge_fo1,
NULL NULL,
}; };
static const char (*merge_base_directories[])[] = { static const char (*merge_base_directories[])[] = {
&merge_dl1, &merge_dl1,
&merge_du1, &merge_du1,
&merge_do1, &merge_do1,
NULL NULL,
}; };
static const char (*merge_sub_files[])[] = { static const char (*merge_sub_files[])[] = {
&merge_dl1_fl2, &merge_dl1_fl2,
...@@ -2379,7 +2379,7 @@ static const char (*merge_sub_files[])[] = { ...@@ -2379,7 +2379,7 @@ static const char (*merge_sub_files[])[] = {
&merge_do1_fo2, &merge_do1_fo2,
&merge_do1_fl3, &merge_do1_fl3,
&merge_do1_fu3, &merge_do1_fu3,
NULL NULL,
}; };
/* /*
...@@ -2544,7 +2544,7 @@ TEST_F_FORK(layout2_overlay, same_content_different_file) ...@@ -2544,7 +2544,7 @@ TEST_F_FORK(layout2_overlay, same_content_different_file)
.path = MERGE_BASE, .path = MERGE_BASE,
.access = ACCESS_RW, .access = ACCESS_RW,
}, },
{} {},
}; };
const struct rule layer2_data[] = { const struct rule layer2_data[] = {
{ {
...@@ -2559,7 +2559,7 @@ TEST_F_FORK(layout2_overlay, same_content_different_file) ...@@ -2559,7 +2559,7 @@ TEST_F_FORK(layout2_overlay, same_content_different_file)
.path = MERGE_DATA, .path = MERGE_DATA,
.access = ACCESS_RW, .access = ACCESS_RW,
}, },
{} {},
}; };
/* Sets access right on directories inside both layers. */ /* Sets access right on directories inside both layers. */
const struct rule layer3_subdirs[] = { const struct rule layer3_subdirs[] = {
...@@ -2591,7 +2591,7 @@ TEST_F_FORK(layout2_overlay, same_content_different_file) ...@@ -2591,7 +2591,7 @@ TEST_F_FORK(layout2_overlay, same_content_different_file)
.path = merge_do1, .path = merge_do1,
.access = ACCESS_RW, .access = ACCESS_RW,
}, },
{} {},
}; };
/* Tighten access rights to the files. */ /* Tighten access rights to the files. */
const struct rule layer4_files[] = { const struct rule layer4_files[] = {
...@@ -2644,7 +2644,7 @@ TEST_F_FORK(layout2_overlay, same_content_different_file) ...@@ -2644,7 +2644,7 @@ TEST_F_FORK(layout2_overlay, same_content_different_file)
.access = LANDLOCK_ACCESS_FS_READ_FILE | .access = LANDLOCK_ACCESS_FS_READ_FILE |
LANDLOCK_ACCESS_FS_WRITE_FILE, LANDLOCK_ACCESS_FS_WRITE_FILE,
}, },
{} {},
}; };
const struct rule layer5_merge_only[] = { const struct rule layer5_merge_only[] = {
{ {
...@@ -2652,7 +2652,7 @@ TEST_F_FORK(layout2_overlay, same_content_different_file) ...@@ -2652,7 +2652,7 @@ TEST_F_FORK(layout2_overlay, same_content_different_file)
.access = LANDLOCK_ACCESS_FS_READ_FILE | .access = LANDLOCK_ACCESS_FS_READ_FILE |
LANDLOCK_ACCESS_FS_WRITE_FILE, LANDLOCK_ACCESS_FS_WRITE_FILE,
}, },
{} {},
}; };
int ruleset_fd; int ruleset_fd;
size_t i; size_t i;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment