chiark / gitweb /
main: refuse system to be started in a chroot
authorLennart Poettering <lennart@poettering.net>
Wed, 9 Mar 2011 22:59:27 +0000 (23:59 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 9 Mar 2011 22:59:27 +0000 (23:59 +0100)
src/main.c

index 769fc6772cad56aae5809b50beb1144195ba1d26..6d1fd7d55d834f5dca74e38e4416c1f26948f535 100644 (file)
@@ -1030,9 +1030,16 @@ int main(int argc, char *argv[]) {
                 goto finish;
         }
 
+        if (arg_running_as == MANAGER_SYSTEM &&
+            arg_action == ACTION_RUN &&
+            running_in_chroot() > 0) {
+                log_error("Cannot be run in a chroot() environment.");
+                goto finish;
+        }
+
         /* If Plymouth is being run make sure we show the status, so
          * that there's something nice to see when people press Esc */
-        if (access("/dev/.run/systemd/plymouth", F_OK) >= 0)
+        if (access("/dev/.systemd/plymouth", F_OK) >= 0)
                 arg_show_status = true;
 
         if (arg_action == ACTION_HELP) {