1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-10 05:18:17 +03:00

core/namespace: take char* const* for strv, use FOREACH_ARRAY

This commit is contained in:
Mike Yuan 2024-05-09 16:48:26 +08:00
parent 63a0e57724
commit d99511add4
No known key found for this signature in database
GPG Key ID: 417471C0A40F58B3

View File

@ -2057,9 +2057,9 @@ static bool root_read_only(
} }
static bool home_read_only( static bool home_read_only(
char** read_only_paths, char * const *read_only_paths,
char** inaccessible_paths, char * const *inaccessible_paths,
char** empty_directories, char * const *empty_directories,
const BindMount *bind_mounts, const BindMount *bind_mounts,
size_t n_bind_mounts, size_t n_bind_mounts,
const TemporaryFileSystem *temporary_filesystems, const TemporaryFileSystem *temporary_filesystems,
@ -2078,13 +2078,13 @@ static bool home_read_only(
prefixed_path_strv_contains(empty_directories, "/home")) prefixed_path_strv_contains(empty_directories, "/home"))
return true; return true;
for (size_t i = 0; i < n_temporary_filesystems; i++) FOREACH_ARRAY(i, temporary_filesystems, n_temporary_filesystems)
if (path_equal(temporary_filesystems[i].path, "/home")) if (path_equal(i->path, "/home"))
return true; return true;
/* If /home is overmounted with some dir from the host it's not writable. */ /* If /home is overmounted with some dir from the host it's not writable. */
for (size_t i = 0; i < n_bind_mounts; i++) FOREACH_ARRAY(i, bind_mounts, n_bind_mounts)
if (path_equal(bind_mounts[i].destination, "/home")) if (path_equal(i->destination, "/home"))
return true; return true;
return false; return false;