]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix a USB printing issue on macOS (rdar://31433931)
authorMichael R Sweet <michael.r.sweet@gmail.com>
Fri, 16 Aug 2019 19:41:00 +0000 (15:41 -0400)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Fri, 16 Aug 2019 19:41:00 +0000 (15:41 -0400)
CHANGES.md
backend/usb-darwin.c

index ffd236f90d2bb328d7462cce5b65c66ff482a8e9..aea4a00cf6589d688ca085d50039deafa40aa02f 100644 (file)
@@ -1,4 +1,4 @@
-CHANGES - 2.3.0 - 2019-08-07
+CHANGES - 2.3.0 - 2019-08-16
 ============================
 
 
@@ -29,6 +29,7 @@ Changes in CUPS v2.3.0
 - Fixed some PPD parser issues (Issue #5623, Issue #5624)
 - The IPP parser no longer allows invalid member attributes in collections
   (Issue #5630)
+- Fixed a USB printing issue on macOS (rdar://31433931)
 - Fixed IPP buffer overflow (rdar://50035411)
 - Fixed memory disclosure issue in the scheduler (rdar://51373853)
 - Fixed DoS issues in the scheduler (rdar://51373929)
index d6ad5875d6649d13acf9d460e520e2b294a5f781..8f37e1bd662d6303d1335e33f29d68960b552755 100644 (file)
@@ -1279,6 +1279,9 @@ static Boolean find_device_cb(io_service_t obj, printer_interface_t printerIntf,
         (*printerIntf)->GetAlternateSetting(printerIntf, &intfAltSetting);
         (*printerIntf)->GetInterfaceNumber(printerIntf, &intfNumber);
         (*printerIntf)->GetLocationID(printerIntf, &intfLocation);
+          
+        if (intfProtocol == kUSBPrintingProtocolIPP)
+            return keepLooking;
 
         if (g.serial != NULL && CFStringGetLength(g.serial) > 0)
         {
@@ -1287,12 +1290,9 @@ static Boolean find_device_cb(io_service_t obj, printer_interface_t printerIntf,
             g.interfaceProtocol = intfProtocol;
             g.location = intfLocation;
             g.alternateSetting = intfAltSetting;
-            if (intfProtocol != kUSBPrintingProtocolIPP)
-            {
-              g.printer_obj = obj;
-              IOObjectRetain(obj);
-            }
-            keepLooking = (intfProtocol == kUSBPrintingProtocolIPP);
+            g.printer_obj = obj;
+            IOObjectRetain(obj);
+            keepLooking = false;
           }
         }
         else
@@ -1300,14 +1300,14 @@ static Boolean find_device_cb(io_service_t obj, printer_interface_t printerIntf,
           if (g.printer_obj != 0)
             IOObjectRelease(g.printer_obj);
 
+            if (g.location == 0 || g.location == intfLocation)
+                keepLooking = false;
+
             g.location = intfLocation;
             g.alternateSetting = intfAltSetting;
             g.interfaceProtocol = intfProtocol;
             g.printer_obj = obj;
             IOObjectRetain(obj);
-
-            if (g.location == 0 || g.location == intfLocation)
-              keepLooking = false;
         }
 
         if (!keepLooking)