]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - scheduler/server.c
Fix local privilege escalation to root and sandbox bypasses in scheduler
[thirdparty/cups.git] / scheduler / server.c
index cecbabe67f82bf54f6d4ad7fc843b38010ee0edf..a4033791b4da1f5533d367ee78156d14cec5a310 100644 (file)
@@ -34,16 +34,28 @@ void
 cupsdStartServer(void)
 {
  /*
-  * Start color management (as needed)...
+  * Create the default security profile...
   */
 
-  cupsdStartColor();
+  DefaultProfile = cupsdCreateProfile(0, 1);
+
+#ifdef HAVE_SANDBOX_H
+  if (!DefaultProfile && UseSandboxing && Sandboxing != CUPSD_SANDBOXING_OFF)
+  {
+   /*
+    * Failure to create the sandbox profile means something really bad has
+    * happened and we need to shutdown immediately.
+    */
+
+    return;
+  }
+#endif /* HAVE_SANDBOX_H */
 
  /*
-  * Create the default security profile...
+  * Start color management (as needed)...
   */
 
-  DefaultProfile = cupsdCreateProfile(0, 1);
+  cupsdStartColor();
 
  /*
   * Startup all the networking stuff...