]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
The scheduler's `-t` option did not force all errors to the standard error
authorMichael Sweet <michael.r.sweet@gmail.com>
Wed, 19 Jul 2017 19:37:30 +0000 (15:37 -0400)
committerMichael Sweet <michael.r.sweet@gmail.com>
Wed, 19 Jul 2017 19:37:30 +0000 (15:37 -0400)
file, making debugging of configuration problems hard (Issue #5041)

CHANGES.md
scheduler/conf.c
scheduler/log.c

index f5c88c728bf89bc7760cb7d566e6809c2abfa390..b247c1f1c86b074f32fc0fcfb94107402b2350f3 100644 (file)
@@ -4,6 +4,8 @@ CHANGES - 2.2.5 - 2017-07-19
 CHANGES IN CUPS V2.2.5
 ----------------------
 
+- The scheduler's `-t` option did not force all errors to the standard error
+  file, making debugging of configuration problems hard (Issue #5041)
 - Fixed a typo in the CUPS Programming Manual (Issue #5042)
 - Fixed RPM packaging issue (Issue #5043, Issue #5044)
 - The `cupsGetDests` function incorrectly returned an empty list of printers if
index 3897073e4439490e21b92a80c7b56f9a17147862..dcac7b60df99b9a26afd8ca04c096ea9160d18f7 100644 (file)
@@ -190,7 +190,7 @@ static void         mime_error_cb(void *ctx, const char *message);
 static int             parse_aaa(cupsd_location_t *loc, char *line,
                                  char *value, int linenum);
 static int             parse_fatal_errors(const char *s);
-static int             parse_groups(const char *s);
+static int             parse_groups(const char *s, int linenum);
 static int             parse_protocols(const char *s);
 static int             parse_variable(const char *filename, int linenum,
                                       const char *line, const char *value,
@@ -953,7 +953,7 @@ cupsdReadConfiguration(void)
 
   if (NumSystemGroups == 0)
   {
-    if (!parse_groups(CUPS_DEFAULT_SYSTEM_GROUPS))
+    if (!parse_groups(CUPS_DEFAULT_SYSTEM_GROUPS, 0))
     {
      /*
       * Find the group associated with GID 0...
@@ -2494,7 +2494,8 @@ parse_fatal_errors(const char *s) /* I - FatalErrors string */
  */
 
 static int                             /* O - 1 on success, 0 on failure */
-parse_groups(const char *s)            /* I - Space-delimited groups */
+parse_groups(const char *s,            /* I - Space-delimited groups */
+             int        linenum)        /* I - Line number in cups-files.conf */
 {
   int          status;                 /* Return status */
   char         value[1024],            /* Value string */
@@ -2550,7 +2551,14 @@ parse_groups(const char *s)              /* I - Space-delimited groups */
       NumSystemGroups ++;
     }
     else
+    {
+      if (linenum)
+        cupsdLogMessage(CUPSD_LOG_ERROR, "Unknown SystemGroup \"%s\" on line %d of %s.", valstart, linenum, CupsFilesFile);
+      else
+        cupsdLogMessage(CUPSD_LOG_ERROR, "Unknown default SystemGroup \"%s\".", valstart);
+
       status = 0;
+    }
 
     endgrent();
 
@@ -3547,11 +3555,8 @@ read_cups_files_conf(cups_file_t *fp)    /* I - File to read from */
       * SystemGroup (admin) group(s)...
       */
 
-      if (!parse_groups(value))
+      if (!parse_groups(value, linenum))
       {
-       cupsdLogMessage(CUPSD_LOG_ERROR,
-                       "Unknown SystemGroup \"%s\" on line %d of %s.", value,
-                       linenum, CupsFilesFile);
         if (FatalErrors & CUPSD_FATAL_CONFIG)
           return (0);
       }
index 95aa23ed6fa3a63e3ad983040ba6c47a94c77e85..3ffa1933da7a523a2a3e418a9ab8e1ebebe48541 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Log file routines for the CUPS scheduler.
  *
- * Copyright 2007-2016 by Apple Inc.
+ * Copyright 2007-2017 by Apple Inc.
  * Copyright 1997-2007 by Easy Software Products, all rights reserved.
  *
  * These coded instructions, statements, and computer programs are the