]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
The cups-lpd mini-daemon incorrectly included the document-name attribute when
authorMichael R Sweet <michaelrsweet@gmail.com>
Thu, 24 Mar 2016 21:18:56 +0000 (17:18 -0400)
committerMichael R Sweet <michaelrsweet@gmail.com>
Thu, 24 Mar 2016 21:18:56 +0000 (17:18 -0400)
creating a job.  It should only be included when sending a job (Issue #4790)

CHANGES-2.1.txt
scheduler/cups-lpd.c
scheduler/ipp.c

index 502226b7f5ed3ee4de686609b41567a398b99599..513e02dabb27d827df588d821aff80867691f733 100644 (file)
@@ -3,28 +3,31 @@ CHANGES-2.1.txt
 
 CHANGES IN CUPS V2.1.4
 
-       - Documentation update (STR #4772)
+       - The cups-lpd mini-daemon incorrectly included the document-name
+         attribute when creating a job.  It should only be included when
+         sending a job (Issue #4790)
+       - Documentation update (Issue #4772)
 
 
 CHANGES IN CUPS V2.1.3
 
        - The default password function did not work on some platforms
-         (STR #4750)
+         (Issue #4750)
        - The scheduler should not exit under memory pressure
          (<rdar://problem/23255001>)
        - The EPL2 and ZPL sample drivers did not properly support the CutMedia
          option.
        - Pending subscriptions would prevent the scheduler from idle exiting
-         (STR #4754)
+         (Issue #4754)
        - Fixed some issues in ipptool for skipped tests
          (<rdar://problem/24137160>)
        - The "lp -H resume" command did not reset the "job-state-reasons"
-         attribute value (STR #4752)
+         attribute value (Issue #4752)
        - cupsEncodeOptions2 incorrectly handled escaped values
          (<rdar://problem/19736672>)
        - The scheduler did not allow access to resource files (icons, etc.)
-         when the web interface was disabled (STR #4755)
-       - Localization fix (STR #4756)
+         when the web interface was disabled (Issue #4755)
+       - Localization fix (Issue #4756)
 
 
 CHANGES IN CUPS V2.1.2
@@ -46,56 +49,56 @@ CHANGES IN CUPS V2.1.1
          <rdar://problem/23135122>, <rdar://problem/23135207>,
          <rdar://problem/23144290>, <rdar://problem/23144358>,
          <rdar://problem/23144461>)
-       - The cupsGetPPD* functions did not work with IPP printers (STR #4725)
+       - The cupsGetPPD* functions did not work with IPP printers (Issue #4725)
        - Some older HP LaserJet printers need a delayed close when printing
-         using the libusb-based USB backend (STR #4549)
+         using the libusb-based USB backend (Issue #4549)
        - The libusb-based USB backend did not unload the kernel usblp module
          if it was preventing the backend from accessing the printer
-         (STR #4707)
+         (Issue #4707)
        - Current Primera printers were incorrectly reported as Fargo printers
-         (STR #4708)
+         (Issue #4708)
        - The IPP backend did not always handle jobs getting canceled at the
          printer (<rdar://problem/22716820>)
-       - Scheduler logging change (STR #4728)
-       - Added USB quirk for Canon MP530 (STR #4730)
+       - Scheduler logging change (Issue #4728)
+       - Added USB quirk for Canon MP530 (Issue #4730)
        - The scheduler did not deliver job notifications for jobs submitted to
-         classes (STR #4733)
+         classes (Issue #4733)
        - Changing the printer-is-shared value for a remote queue did not
-         produce an error (STR #4738)
+         produce an error (Issue #4738)
        - The IPP backend incorrectly included the job-password attribute in
          Validate-Job requests (<rdar://problem/23531939>)
-       - Updated localizations (STR #4709)
+       - Updated localizations (Issue #4709)
 
 
 CHANGES IN CUPS V2.1.0
 
-       - Fixed more scheduler crash bugs in the new logging code (STR #4687,
-         STR #4690)
+       - Fixed more scheduler crash bugs in the new logging code (Issue #4687,
+         Issue #4690)
        - The scheduler did not use the ConfigFilePerm setting when copying PPD
-         files or interface scripts attached to a request (STR #4703)
+         files or interface scripts attached to a request (Issue #4703)
        - Now support new Chinese locale IDs and their correct fallback locales
          (<rdar://problem/22086642>, <rdar://problem/22130168>)
        - "make check" incorrectly reported an expectation of 18 warning
-         messages when 8 were expected (STR #4684)
-       - The new PDF file type rule did not work (STR #4692)
+         messages when 8 were expected (Issue #4684)
+       - The new PDF file type rule did not work (Issue #4692)
        - The scheduler did not update the jobs.cache file when job files were
-         expired (STR #4706)
-       - Fixed some configure script issues (STR #4694, STR #4695, STR #4698)
-       - Documentation updates (STR #4691, STR #4693)
+         expired (Issue #4706)
+       - Fixed some configure script issues (Issue #4694, Issue #4695, Issue #4698)
+       - Documentation updates (Issue #4691, Issue #4693)
 
 
 CHANGES IN CUPS V2.1rc1
 
        - Added support for 3D printers (basic types only, no built-in filters)
          based on PWG white paper.
-       - Fixed bugs in the new journald support (STR #4655, STR #4658,
-         STR #4661)
-       - Fixed domain socket support on Linux (STR #4679)
-       - Fixed signal handlers in the dnssd and usb backends (STR #4671)
+       - Fixed bugs in the new journald support (Issue #4655, Issue #4658,
+         Issue #4661)
+       - Fixed domain socket support on Linux (Issue #4679)
+       - Fixed signal handlers in the dnssd and usb backends (Issue #4671)
        - <Limit All> in <Policy> sections now applies to all operations when
-         used by itself (STR #4659)
-       - Configure script changes for systemd support (STR #4669)
-       - Updated autoconf sources to use newer form of AC_INIT (STR #4664)
+         used by itself (Issue #4659)
+       - Configure script changes for systemd support (Issue #4669)
+       - Updated autoconf sources to use newer form of AC_INIT (Issue #4664)
 
 
 CHANGES IN CUPS V2.1b1
@@ -110,30 +113,30 @@ CHANGES IN CUPS V2.1b1
        - The IPP backend now updates the cupsMandatory values when the printer
          configuration changes (<rdar://problem/18126570>)
        - No longer install banner files since third-party banner filters now
-         supply their own (STR #4518)
+         supply their own (Issue #4518)
        - Added support for EXPECT-ALL directive in ipptool test files
-         (STR #4469)
+         (Issue #4469)
        - Added support for WITH-VALUE-FROM predicate in ipptool test files
-         (STR #4470)
+         (Issue #4470)
        - The scheduler no longer listens on the loopback interface unless the
          web interface or printer sharing are enabled
          (<rdar://problem/9136448>)
-       - Added a PPD generator for IPP Everywhere printers (STR #4258)
+       - Added a PPD generator for IPP Everywhere printers (Issue #4258)
        - Now install "default" versions of more configuration files
          (<rdar://problem/19024491>)
        - The cupstestppd program did not handle "maxsize(nnn)" entries in
          cupsFilter/cupsFilter2 values (<rdar://problem/18974858>)
        - The scheduler now checks the return value of rename() calls
-         (STR #4589)
+         (Issue #4589)
        - The scheduler now validates ErrorPolicy values in config files
-         (STR #4591)
-       - Long cookies caused the web interface to stop working (STR #4619)
+         (Issue #4591)
+       - Long cookies caused the web interface to stop working (Issue #4619)
        - Added SSLOptions values to allow Diffie-Hellman key exchange and
          disable TLS/1.0 support.
        - Updated the scheduler to support more IPP Everywhere attributes
-         (STR #4630)
+         (Issue #4630)
        - The scheduler now supports advanced ASL and journald logging when
-         "syslog" output is configured (STR #4474)
+         "syslog" output is configured (Issue #4474)
        - The scheduler now supports logging to stderr when running in the
-         foreground (STR #4505)
+         foreground (Issue #4505)
 
index 798ee0588e0159354609c1b884e22a6287a8464c..3a67e1ce24d9c80efc68531bafe25bcba624b9ee 100644 (file)
@@ -1,9 +1,7 @@
 /*
- * "$Id$"
- *
  * Line Printer Daemon interface for CUPS.
  *
- * Copyright 2007-2015 by Apple Inc.
+ * Copyright 2007-2016 by Apple Inc.
  * Copyright 1997-2006 by Easy Software Products, all rights reserved.
  *
  * These coded instructions, statements, and computer programs are the
@@ -17,6 +15,7 @@
  * Include necessary headers...
  */
 
+#define _CUPS_NO_DEPRECATED
 #include <cups/cups-private.h>
 #include <syslog.h>
 #include <unistd.h>
@@ -346,7 +345,7 @@ create_job(http_t        *http,             /* I - HTTP connection */
   * Setup the Create-Job request...
   */
 
-  request = ippNewRequest(IPP_CREATE_JOB);
+  request = ippNewRequest(IPP_OP_CREATE_JOB);
 
   httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL,
                    "localhost", 0, "/printers/%s", dest);
@@ -361,10 +360,6 @@ create_job(http_t        *http,            /* I - HTTP connection */
     ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "job-name",
                  NULL, title);
 
-  if (docname[0])
-    ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "document-name",
-                 NULL, docname);
-
   cupsEncodeOptions(request, num_options, options);
 
  /*
@@ -375,7 +370,7 @@ create_job(http_t        *http,             /* I - HTTP connection */
 
   response = cupsDoRequest(http, request, uri);
 
-  if (!response || cupsLastError() > IPP_OK_CONFLICT)
+  if (!response || cupsLastError() > IPP_STATUS_OK_CONFLICTING)
   {
     syslog(LOG_ERR, "Unable to create job - %s", cupsLastErrorString());
 
@@ -451,7 +446,7 @@ get_printer(http_t        *http,    /* I - HTTP connection */
   if (shared)
     *shared = 0;
   if (state)
-    *state = IPP_PRINTER_STOPPED;
+    *state = IPP_PSTATE_STOPPED;
   if (options)
     *options = NULL;
 
@@ -467,7 +462,7 @@ get_printer(http_t        *http,    /* I - HTTP connection */
   * Setup the Get-Printer-Attributes request...
   */
 
-  request = ippNewRequest(IPP_GET_PRINTER_ATTRIBUTES);
+  request = ippNewRequest(IPP_OP_GET_PRINTER_ATTRIBUTES);
 
   httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL,
                   "localhost", 0, "/printers/%s", dest);
@@ -486,7 +481,7 @@ get_printer(http_t        *http,    /* I - HTTP connection */
 
   response = cupsDoRequest(http, request, "/");
 
-  if (!response || cupsLastError() > IPP_OK_CONFLICT)
+  if (!response || cupsLastError() > IPP_STATUS_OK_CONFLICTING)
   {
    /*
     * If we can't find the printer by name, look up the printer-name
@@ -506,7 +501,7 @@ get_printer(http_t        *http,    /* I - HTTP connection */
     * Setup the CUPS-Get-Printers request...
     */
 
-    request = ippNewRequest(CUPS_GET_PRINTERS);
+    request = ippNewRequest(IPP_OP_CUPS_GET_PRINTERS);
 
     ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
                   "requested-attributes",
@@ -519,7 +514,7 @@ get_printer(http_t        *http,    /* I - HTTP connection */
 
     response = cupsDoRequest(http, request, "/");
 
-    if (!response || cupsLastError() > IPP_OK_CONFLICT)
+    if (!response || cupsLastError() > IPP_STATUS_OK_CONFLICTING)
     {
       syslog(LOG_ERR, "Unable to get list of printers - %s",
              cupsLastErrorString());
@@ -734,7 +729,7 @@ print_file(http_t     *http,                /* I - HTTP connection */
   * Setup the Send-Document request...
   */
 
-  request = ippNewRequest(IPP_SEND_DOCUMENT);
+  request = ippNewRequest(IPP_OP_SEND_DOCUMENT);
 
   snprintf(uri, sizeof(uri), "ipp://localhost/jobs/%d", id);
   ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "job-uri", NULL, uri);
@@ -760,7 +755,7 @@ print_file(http_t     *http,                /* I - HTTP connection */
 
   ippDelete(cupsDoFileRequest(http, request, uri, filename));
 
-  if (cupsLastError() > IPP_OK_CONFLICT)
+  if (cupsLastError() > IPP_STATUS_OK_CONFLICTING)
   {
     syslog(LOG_ERR, "Unable to send document - %s", cupsLastErrorString());
 
@@ -815,7 +810,7 @@ recv_print_job(
   * Connect to the server...
   */
 
-  http = httpConnectEncrypt(cupsServer(), ippPort(), cupsEncryption());
+  http = httpConnect2(cupsServer(), ippPort(), NULL, AF_UNSPEC, cupsEncryption(), 1, 30000, NULL);
   if (!http)
   {
     syslog(LOG_ERR, "Unable to connect to server: %s", strerror(errno));
@@ -1245,8 +1240,7 @@ remove_jobs(const char *dest,             /* I - Destination */
   * Try connecting to the local server...
   */
 
-  if ((http = httpConnectEncrypt(cupsServer(), ippPort(),
-                                 cupsEncryption())) == NULL)
+  if ((http = httpConnect2(cupsServer(), ippPort(), NULL, AF_UNSPEC, cupsEncryption(), 1, 30000, NULL)) == NULL)
   {
     syslog(LOG_ERR, "Unable to connect to server %s: %s", cupsServer(),
            strerror(errno));
@@ -1269,7 +1263,7 @@ remove_jobs(const char *dest,             /* I - Destination */
       list ++;
 
    /*
-    * Build an IPP_CANCEL_JOB request, which requires the following
+    * Build an IPP_OP_CANCEL_JOB request, which requires the following
     * attributes:
     *
     *    attributes-charset
@@ -1278,7 +1272,7 @@ remove_jobs(const char *dest,             /* I - Destination */
     *    requesting-user-name
     */
 
-    request = ippNewRequest(IPP_CANCEL_JOB);
+    request = ippNewRequest(IPP_OP_CANCEL_JOB);
 
     sprintf(uri, "ipp://localhost/jobs/%d", id);
     ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "job-uri", NULL, uri);
@@ -1292,7 +1286,7 @@ remove_jobs(const char *dest,             /* I - Destination */
 
     ippDelete(cupsDoRequest(http, request, "/jobs"));
 
-    if (cupsLastError() > IPP_OK_CONFLICT)
+    if (cupsLastError() > IPP_STATUS_OK_CONFLICTING)
     {
       syslog(LOG_WARNING, "Cancel of job ID %d failed: %s\n", id,
              cupsLastErrorString());
@@ -1366,8 +1360,7 @@ send_state(const char *queue,             /* I - Destination */
   * Try connecting to the local server...
   */
 
-  if ((http = httpConnectEncrypt(cupsServer(), ippPort(),
-                                 cupsEncryption())) == NULL)
+  if ((http = httpConnect2(cupsServer(), ippPort(), NULL, AF_UNSPEC, cupsEncryption(), 1, 30000, NULL)) == NULL)
   {
     syslog(LOG_ERR, "Unable to connect to server %s: %s", cupsServer(),
            strerror(errno));
@@ -1393,19 +1386,19 @@ send_state(const char *queue,           /* I - Destination */
 
   switch (state)
   {
-    case IPP_PRINTER_IDLE :
+    case IPP_PSTATE_IDLE :
         printf("%s is ready\n", dest);
        break;
-    case IPP_PRINTER_PROCESSING :
+    case IPP_PSTATE_PROCESSING :
         printf("%s is ready and printing\n", dest);
        break;
-    case IPP_PRINTER_STOPPED :
+    case IPP_PSTATE_STOPPED :
         printf("%s is not ready\n", dest);
        break;
   }
 
  /*
-  * Build an IPP_GET_JOBS or IPP_GET_JOB_ATTRIBUTES request, which requires
+  * Build an IPP_OP_GET_JOBS or IPP_OP_GET_JOB_ATTRIBUTES request, which requires
   * the following attributes:
   *
   *    attributes-charset
@@ -1415,7 +1408,7 @@ send_state(const char *queue,             /* I - Destination */
 
   id = atoi(list);
 
-  request = ippNewRequest(id ? IPP_GET_JOB_ATTRIBUTES : IPP_GET_JOBS);
+  request = ippNewRequest(id ? IPP_OP_GET_JOB_ATTRIBUTES : IPP_OP_GET_JOBS);
 
   httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL,
                    "localhost", 0, "/printers/%s", dest);
@@ -1444,7 +1437,7 @@ send_state(const char *queue,             /* I - Destination */
   jobcount = 0;
   response = cupsDoRequest(http, request, "/");
 
-  if (cupsLastError() > IPP_OK_CONFLICT)
+  if (cupsLastError() > IPP_STATUS_OK_CONFLICTING)
   {
     printf("get-jobs failed: %s\n", cupsLastErrorString());
     ippDelete(response);
@@ -1473,7 +1466,7 @@ send_state(const char *queue,             /* I - Destination */
 
     jobid     = 0;
     jobsize   = 0;
-    jobstate  = IPP_JOB_PENDING;
+    jobstate  = IPP_JSTATE_PENDING;
     jobname   = "untitled";
     jobuser   = NULL;
     jobdest   = NULL;
@@ -1534,7 +1527,7 @@ send_state(const char *queue,             /* I - Destination */
     * Display the job...
     */
 
-    if (jobstate == IPP_JOB_PROCESSING)
+    if (jobstate == IPP_JSTATE_PROCESSING)
       strlcpy(rankstr, "active", sizeof(rankstr));
     else
     {
@@ -1626,8 +1619,3 @@ smart_gets(char *s,                       /* I - Pointer to line buffer */
   else
     return (s);
 }
-
-
-/*
- * End of "$Id$".
- */
index 6ccdc68895a0c3d651e65ed1b917d6b62a9b20cc..cc6e70eabb8ffc312da9329af43ac3eec60e7211 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * "$Id$"
- *
  * IPP routines for the CUPS scheduler.
  *
  * Copyright 2007-2016 by Apple Inc.
@@ -11400,8 +11398,3 @@ validate_user(cupsd_job_t    *job,      /* I - Job */
   return (cupsdCheckPolicy(printer ? printer->op_policy_ptr : DefaultPolicyPtr,
                            con, owner) == HTTP_OK);
 }
-
-
-/*
- * End of "$Id$".
- */