]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/namespace: take char* const* for strv, use FOREACH_ARRAY 32733/head
authorMike Yuan <me@yhndnzj.com>
Thu, 9 May 2024 08:48:26 +0000 (16:48 +0800)
committerMike Yuan <me@yhndnzj.com>
Thu, 9 May 2024 09:02:19 +0000 (17:02 +0800)
src/core/namespace.c

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