]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: actually mount / read-only
authorFrantisek Sumsal <frantisek@sumsal.cz>
Tue, 11 Jul 2023 18:18:19 +0000 (20:18 +0200)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Wed, 12 Jul 2023 11:37:21 +0000 (11:37 +0000)
src/test/test-execute.c

index 27d2af78f36f598dad5ae91b8ea00b689bd3fa11..9705cbce594d3ea5d4e00a8f180bbad4c55534f5 100644 (file)
@@ -1289,7 +1289,7 @@ static int prepare_ns(const char *process_name) {
                 _cleanup_free_ char *unit_dir = NULL;
 
                 /* Make "/" read-only. */
-                assert_se(mount_nofollow_verbose(LOG_DEBUG, NULL, "/", NULL, MS_BIND|MS_REMOUNT, NULL) >= 0);
+                assert_se(mount_nofollow_verbose(LOG_DEBUG, NULL, "/", NULL, MS_BIND|MS_REMOUNT|MS_RDONLY, NULL) >= 0);
 
                 /* Creating a new user namespace in the above means all MS_SHARED mounts become MS_SLAVE.
                  * Let's put them back to MS_SHARED here, since that's what we want as defaults. (This will