]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
More changes for STR #4223:
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Wed, 12 Dec 2012 18:02:06 +0000 (18:02 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Wed, 12 Dec 2012 18:02:06 +0000 (18:02 +0000)
- Fix cupsctl man page
- Generate and install cups-files.conf online help.
- Fix "-t" operation that shows correct filename.
- Use syslog for startup errors.
- Fix installation of cupsd.conf - need to use ConfigurationFile and not ServerRoot/cupsd.conf.
- Check permissions of ConfigurationFile and CupsFilesFile - should be ConfigFilePerm.

git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@10751 7a7537e8-13f0-0310-91df-b6672ffda945

CHANGES-1.6.txt
configure.in
doc/Makefile
man/cupsctl.man
scheduler/client.c
scheduler/conf.c
scheduler/log.c
scheduler/main.c

index f3d2427c7be701865c856f6670ce4c3b93f3d8d4..0b4018760bf274bda4e1cd91f00b4291a12c0a79 100644 (file)
@@ -7,6 +7,8 @@ CHANGES IN CUPS V1.6.2
        - Security: All file, directory, user, and group settings are now stored
          in a separate cups-files.conf configuration file that cannot be set
          through the CUPS web interface or APIs (STR #4223)
+       - cupsGetPPD3 could return a local PPD instead of the correct remote
+         PPD.
        - The scheduler incorrectly advertised auth-info-required for local
          queues needing local authentication (STR #4205)
        - CUPS 1.6 clients using the ServerName directive in client.conf did not
index 62b92ea859fe68023a685a71dc3b8667313e617e..fd0e079db5a23dbac2db5ae0fbab5488fe22b611 100644 (file)
@@ -68,6 +68,7 @@ AC_OUTPUT(Makedefs
          cups-config
          data/testprint
          desktop/cups.desktop
+         doc/help/ref-cups-files-conf.html
          doc/help/ref-cupsd-conf.html
          doc/help/standard.html
          doc/index.html
index 8357e80b79c2ecc9d229034a9916ba422060844b..939ea14330f2c0c97265f139b1794af433d10a35 100644 (file)
@@ -105,6 +105,7 @@ HELPFILES   =       \
                        help/ref-classes-conf.html \
                        help/ref-client-conf.html \
                        help/ref-cupsd-conf.html \
+                       help/ref-cups-files-conf.html \
                        help/ref-error_log.html \
                        help/ref-mailto-conf.html \
                        help/ref-page_log.html \
index a9e3ac14b0c23e6f2f5d3a2afec971f2732c150b..570afea902d40269d293746526994ff1b7debc32 100644 (file)
@@ -12,7 +12,7 @@
 .\"   which should have been included with this file.  If this file is
 .\"   file is missing or damaged, see the license at "http://www.cups.org/".
 .\"
-.TH cupsctl 8 "CUPS" "16 July 2012" "Apple Inc."
+.TH cupsctl 8 "CUPS" "12 December 2012" "Apple Inc."
 .SH NAME
 cupsctl \- configure cupsd.conf options
 .SH SYNOPSIS
@@ -84,11 +84,6 @@ Disable printer sharing:
 .nf
     cupsctl --no-shared-printers
 .fi
-.LP
-Enable printing using the file: pseudo-device:
-.nf
-    cupsctl FileDevice=Yes
-.fi
 .SH KNOWN ISSUES
 You cannot set the Listen or Port directives using \fIcupsctl\fR.
 .SH SEE ALSO
index 06c90647aa264865092b26294eff04d9f49a5464..bb03d1cef3e453093901dd28edcb639c077cf022 100644 (file)
@@ -3336,14 +3336,14 @@ install_cupsd_conf(cupsd_client_t *con) /* I - Connection */
   * Open the new config file...
   */
 
-  snprintf(filename, sizeof(filename), "%s/cupsd.conf", ServerRoot);
-  if ((out = cupsdCreateConfFile(filename, ConfigFilePerm)) == NULL)
+  if ((out = cupsdCreateConfFile(ConfigurationFile, ConfigFilePerm)) == NULL)
   {
     cupsFileClose(in);
     return (HTTP_SERVER_ERROR);
   }
 
-  cupsdLogMessage(CUPSD_LOG_INFO, "Installing config file \"%s\"...", filename);
+  cupsdLogMessage(CUPSD_LOG_INFO, "Installing config file \"%s\"...",
+                  ConfigurationFile);
 
  /*
   * Copy from the request to the new config file...
@@ -3354,12 +3354,12 @@ install_cupsd_conf(cupsd_client_t *con) /* I - Connection */
     {
       cupsdLogMessage(CUPSD_LOG_ERROR,
                       "Unable to copy to config file \"%s\": %s",
-                     filename, strerror(errno));
+                     ConfigurationFile, strerror(errno));
 
       cupsFileClose(in);
       cupsFileClose(out);
 
-      snprintf(filename, sizeof(filename), "%s%s.N", ServerRoot, con->uri + 11);
+      snprintf(filename, sizeof(filename), "%s.N", ConfigurationFile);
       cupsdRemoveFile(filename);
 
       return (HTTP_SERVER_ERROR);
@@ -3371,7 +3371,7 @@ install_cupsd_conf(cupsd_client_t *con)   /* I - Connection */
 
   cupsFileClose(in);
 
-  if (cupsdCloseCreatedConfFile(out, filename))
+  if (cupsdCloseCreatedConfFile(out, ConfigurationFile))
     return (HTTP_SERVER_ERROR);
 
  /*
index 8e169e1728bc3ef01dec875d238b191855eeabaf..1d741d041fd7e2edfe96562768f881470d7778fe 100644 (file)
@@ -797,14 +797,22 @@ cupsdReadConfiguration(void)
     cupsFileClose(fp);
 
     if (!status)
+    {
+      if (TestConfigFile)
+        printf("\"%s\" contains errors.\n", CupsFilesFile);
+      else
+        syslog(LOG_LPR, "Unable to read \"%s\" due to errors.",
+               CupsFilesFile);
+
       return (0);
+    }
   }
   else if (errno == ENOENT)
     cupsdLogMessage(CUPSD_LOG_INFO, "No %s, using defaults.", CupsFilesFile);
   else
   {
-    cupsdLogMessage(CUPSD_LOG_CRIT, "Unable to open %s: %s", CupsFilesFile,
-                    strerror(errno));
+    syslog(LOG_LPR, "Unable to open \"%s\": %s", CupsFilesFile,
+          strerror(errno));
     return (0);
   }
 
@@ -817,8 +825,8 @@ cupsdReadConfiguration(void)
 
   if ((fp = cupsFileOpen(ConfigurationFile, "r")) == NULL)
   {
-    cupsdLogMessage(CUPSD_LOG_CRIT, "Unable to open %s: %s", ConfigurationFile,
-                    strerror(errno));
+    syslog(LOG_LPR, "Unable to open \"%s\": %s", ConfigurationFile,
+          strerror(errno));
     return (0);
   }
 
@@ -827,7 +835,15 @@ cupsdReadConfiguration(void)
   cupsFileClose(fp);
 
   if (!status)
+  {
+    if (TestConfigFile)
+      printf("\"%s\" contains errors.\n", ConfigurationFile);
+    else
+      syslog(LOG_LPR, "Unable to read \"%s\" due to errors.",
+            ConfigurationFile);
+
     return (0);
+  }
 
   RunUser = getuid();
 
@@ -1108,7 +1124,9 @@ cupsdReadConfiguration(void)
                             Group, 1, 1) < 0 ||
        cupsdCheckPermissions(ServerRoot, "ssl", 0700, RunUser,
                             Group, 1, 0) < 0 ||
-       cupsdCheckPermissions(ServerRoot, "cupsd.conf", ConfigFilePerm, RunUser,
+       cupsdCheckPermissions(ConfigurationFile, NULL, ConfigFilePerm, RunUser,
+                            Group, 0, 0) < 0 ||
+       cupsdCheckPermissions(CupsFilesFile, NULL, ConfigFilePerm, RunUser,
                             Group, 0, 0) < 0 ||
        cupsdCheckPermissions(ServerRoot, "classes.conf", 0600, RunUser,
                             Group, 0, 0) < 0 ||
index 93265afd50568034054c344ddc0e8457404a5b21..0d49357364b91c74374256bd64eac30d90538007 100644 (file)
 static int     log_linesize = 0;       /* Size of line for output file */
 static char    *log_line = NULL;       /* Line for output file */
 
+#ifdef HAVE_VSYSLOG
+static const int syslevels[] =         /* SYSLOG levels... */
+               {
+                 0,
+                 LOG_EMERG,
+                 LOG_ALERT,
+                 LOG_CRIT,
+                 LOG_ERR,
+                 LOG_WARNING,
+                 LOG_NOTICE,
+                 LOG_INFO,
+                 LOG_DEBUG,
+                 LOG_DEBUG
+               };
+#endif /* HAVE_VSYSLOG */
+
 
 /*
  * Local functions...
@@ -543,8 +559,12 @@ cupsdLogMessage(int        level,  /* I - Log level */
   if ((TestConfigFile || !ErrorLog) && level <= CUPSD_LOG_WARN)
   {
     va_start(ap, message);
+#ifdef HAVE_VSYSLOG
+    vsyslog(LOG_LPR | syslevels[level], message, ap);
+#else
     vfprintf(stderr, message, ap);
     putc('\n', stderr);
+#endif /* HAVE_VSYSLOG */
     va_end(ap);
 
     return (1);
@@ -984,21 +1004,6 @@ cupsdWriteErrorLog(int        level,      /* I - Log level */
                  'D',
                  'd'
                };
-#ifdef HAVE_VSYSLOG
-  static const int     syslevels[] =   /* SYSLOG levels... */
-               {
-                 0,
-                 LOG_EMERG,
-                 LOG_ALERT,
-                 LOG_CRIT,
-                 LOG_ERR,
-                 LOG_WARNING,
-                 LOG_NOTICE,
-                 LOG_INFO,
-                 LOG_DEBUG,
-                 LOG_DEBUG
-               };
-#endif /* HAVE_VSYSLOG */
 
 
 #ifdef HAVE_VSYSLOG
index ae539643222c4ca54ddecf72da5d5a42b200295e..625bbc0233b0c92a3e263b5651200d789245183b 100644 (file)
@@ -535,17 +535,11 @@ main(int  argc,                           /* I - Number of command-line args */
   */
 
   if (!cupsdReadConfiguration())
-  {
-    if (TestConfigFile)
-      printf("%s contains errors\n", ConfigurationFile);
-    else
-      syslog(LOG_LPR, "Unable to read configuration file \'%s\' - exiting!",
-            ConfigurationFile);
     return (1);
-  }
   else if (TestConfigFile)
   {
-    printf("%s is OK\n", ConfigurationFile);
+    printf("\"%s\" is OK.\n", CupsFilesFile);
+    printf("\"%s\" is OK.\n", ConfigurationFile);
     return (0);
   }