]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - scheduler/main.c
Merge changes from CUPS 1.3.1.
[thirdparty/cups.git] / scheduler / main.c
index f9f1ba9b143e044906a6c1ddfd166f8b9e12268a..6b4d83993387b2c8edf59ab0ffcf15d36529b280 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: main.c 6755 2007-08-01 19:02:47Z mike $"
+ * "$Id: main.c 6915 2007-09-05 21:05:17Z mike $"
  *
  *   Scheduler main loop for the Common UNIX Printing System (CUPS).
  *
@@ -152,6 +152,18 @@ main(int  argc,                            /* I - Number of command-line args */
 #endif /* HAVE_LAUNCHD */
 
 
+#ifdef HAVE_GETEUID
+ /*
+  * Check for setuid invocation, which we do not support!
+  */
+
+  if (getuid() != geteuid())
+  {
+    fputs("cupsd: Cannot run as a setuid program!\n", stderr);
+    return (1);
+  }
+#endif /* HAVE_GETEUID */
+
  /*
   * Check for command-line arguments...
   */
@@ -1880,5 +1892,5 @@ usage(int status)                 /* O - Exit status */
 
 
 /*
- * End of "$Id: main.c 6755 2007-08-01 19:02:47Z mike $".
+ * End of "$Id: main.c 6915 2007-09-05 21:05:17Z mike $".
  */