]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Sync up with changes from 2.2.x.
authorMichael R Sweet <michael.r.sweet@gmail.com>
Sat, 18 Aug 2018 13:01:32 +0000 (09:01 -0400)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Sat, 18 Aug 2018 13:01:32 +0000 (09:01 -0400)
CHANGES.md
scheduler/ipp.c
systemv/lpadmin.c

index f5112b0fbcba97ecd5524cbd6a272cd35c63a46f..30834f94e37189d22ef15f6ef06eb396f1823284 100644 (file)
@@ -1,4 +1,4 @@
-CHANGES - 2.3b6 - 2018-07-18
+CHANGES - 2.3b6 - 2018-08-18
 ============================
 
 Changes in CUPS v2.3b6
@@ -20,6 +20,8 @@ Changes in CUPS v2.3b6
 - Fixed some typos in the label printer drivers (Issue #5350)
 - The scheduler was being backgrounded on macOS, causing applications to spin
   (rdar://40436080)
+- The scheduler did not validate that required initial request attributes were
+  in the operation group (rdar://41098178)
 - Authentication in the web interface did not work on macOS (rdar://41444473)
 - Fixed a memory leak for some IPP (extension) syntaxes.
 
index 979b31a8b74286dac8631c8fe519742b432828d7..1fe068f1137f541b5f5f2dca07a8e5a747fbf45f 100644 (file)
@@ -248,7 +248,7 @@ cupsdProcessIPPRequest(
       */
 
       attr = con->request->attrs;
-      if (attr && attr->name && !strcmp(attr->name, "attributes-charset") && (attr->value_tag & IPP_TAG_MASK) == IPP_TAG_CHARSET)
+      if (attr && attr->name && !strcmp(attr->name, "attributes-charset") && (attr->value_tag & IPP_TAG_MASK) == IPP_TAG_CHARSET && attr->group_tag == IPP_TAG_OPERATION)
        charset = attr;
       else
        charset = NULL;
@@ -256,7 +256,7 @@ cupsdProcessIPPRequest(
       if (attr)
         attr = attr->next;
 
-      if (attr && attr->name && !strcmp(attr->name, "attributes-natural-language") && (attr->value_tag & IPP_TAG_MASK) == IPP_TAG_LANGUAGE)
+      if (attr && attr->name && !strcmp(attr->name, "attributes-natural-language") && (attr->value_tag & IPP_TAG_MASK) == IPP_TAG_LANGUAGE && attr->group_tag == IPP_TAG_OPERATION)
       {
        language = attr;
 
@@ -274,12 +274,12 @@ cupsdProcessIPPRequest(
       else
        language = NULL;
 
-      if ((attr = ippFindAttribute(con->request, "printer-uri", IPP_TAG_URI)) != NULL)
+      if ((attr = ippFindAttribute(con->request, "printer-uri", IPP_TAG_URI)) != NULL && attr->group_tag == IPP_TAG_OPERATION)
        uri = attr;
-      else if ((attr = ippFindAttribute(con->request, "job-uri", IPP_TAG_URI)) != NULL)
+      else if ((attr = ippFindAttribute(con->request, "job-uri", IPP_TAG_URI)) != NULL && attr->group_tag == IPP_TAG_OPERATION)
        uri = attr;
-      else if (con->request->request.op.operation_id == CUPS_GET_PPD)
-        uri = ippFindAttribute(con->request, "ppd-name", IPP_TAG_NAME);
+      else if (con->request->request.op.operation_id == CUPS_GET_PPD && (attr = ippFindAttribute(con->request, "ppd-name", IPP_TAG_NAME)) != NULL && attr->group_tag == IPP_TAG_OPERATION)
+        uri = attr;
       else
        uri = NULL;
 
@@ -2012,7 +2012,7 @@ add_job_subscriptions(
                host[HTTP_MAX_URI],     /* Host portion of URI */
                resource[HTTP_MAX_URI]; /* Resource portion of URI */
         int    port;                   /* Port portion of URI */
-
+        struct stat info;              /* File information */
 
         recipient = attr->values[0].string.text;
 
@@ -2028,9 +2028,8 @@ add_job_subscriptions(
          return;
        }
 
-        snprintf(notifier, sizeof(notifier), "%s/notifier/%s", ServerBin,
-                scheme);
-        if (access(notifier, X_OK) || !strcmp(scheme, ".") || !strcmp(scheme, ".."))
+        snprintf(notifier, sizeof(notifier), "%s/notifier/%s", ServerBin, scheme);
+        if (access(notifier, X_OK) || stat(notifier, &info) || !S_ISREG(info.st_mode))
        {
           send_ipp_status(con, IPP_NOT_POSSIBLE,
                          _("notify-recipient-uri URI \"%s\" uses unknown "
@@ -5756,7 +5755,7 @@ create_subscriptions(
 
         snprintf(notifier, sizeof(notifier), "%s/notifier/%s", ServerBin,
                 scheme);
-        if (access(notifier, X_OK))
+        if (access(notifier, X_OK) || !strcmp(scheme, ".") || !strcmp(scheme, ".."))
        {
           send_ipp_status(con, IPP_NOT_POSSIBLE,
                          _("notify-recipient-uri URI \"%s\" uses unknown "
index aaebd3eed54563c67d6260bc5abf6d3342a22b15..bd4eb0164a6698b9f00c64f6cb130f9f7b818e6b 100644 (file)
@@ -608,10 +608,18 @@ main(int  argc,                           /* I - Number of command-line arguments */
 
   if (ppd_name && !strcmp(ppd_name, "raw"))
   {
+#ifdef __APPLE__
+    _cupsLangPuts(stderr, _("lpadmin: Raw queues are no longer supported on macOS."));
+#else
     _cupsLangPuts(stderr, _("lpadmin: Raw queues are deprecated and will stop working in a future version of CUPS."));
+#endif /* __APPLE__ */
 
     if (device_uri && (!strncmp(device_uri, "ipp://", 6) || !strncmp(device_uri, "ipps://", 7)) && strstr(device_uri, "/printers/"))
       _cupsLangPuts(stderr, _("lpadmin: Use the 'everywhere' model for shared printers."));
+
+#ifdef __APPLE__
+    return (1);
+#endif /* __APPLE__ */
   }
   else if (ppd_name && !strcmp(ppd_name, "everywhere") && device_uri)
   {