From bee9347973db7543a81b18a854a38c5abed3290b Mon Sep 17 00:00:00 2001 From: Zdenek Dohnal Date: Nov 25 2020 11:04:56 +0000 Subject: take SNMP OID from upstream --- diff --git a/0001-Let-snmp-backend-also-use-manufacturer-specific-MIBs.patch b/0001-Let-snmp-backend-also-use-manufacturer-specific-MIBs.patch new file mode 100644 index 0000000..5352ab5 --- /dev/null +++ b/0001-Let-snmp-backend-also-use-manufacturer-specific-MIBs.patch @@ -0,0 +1,52 @@ +From 48655d013efbbebf5cb489458789e15356ea63eb Mon Sep 17 00:00:00 2001 +From: Tim Waugh +Date: Tue, 9 Aug 2016 18:11:30 +0200 +Subject: [PATCH] Let snmp backend also use manufacturer-specific MIBs +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + + … of HP and Ricoh to obtain the device IDs of network-connected + printers. This way we get more reliable information about make and model + and in addition the supported page description languages, which allows one to + identify whether an optional PostScript add-on is installed or for an + unsupported printer which generic PPD is the best choice (requested by + Ricoh). +Bug: https://github.com/apple/cups/issues/3552 +Patch-Name: Let-snmp-backend-also-use-manufacturer-specific-MIBs.patch +--- + backend/snmp.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/backend/snmp.c b/backend/snmp.c +index 66ac884c6..9572822a8 100644 +--- a/backend/snmp.c ++++ b/backend/snmp.c +@@ -154,6 +154,8 @@ static const int UriOID[] = { CUPS_OID_ppmPortServiceNameOrURI, 1, 1, -1 }; + static const int LexmarkProductOID[] = { 1,3,6,1,4,1,641,2,1,2,1,2,1,-1 }; + static const int LexmarkProductOID2[] = { 1,3,6,1,4,1,674,10898,100,2,1,2,1,2,1,-1 }; + static const int LexmarkDeviceIdOID[] = { 1,3,6,1,4,1,641,2,1,2,1,3,1,-1 }; ++static const int HPDeviceIdOID[] = { 1,3,6,1,4,1,11,2,3,9,1,1,7,0,-1 }; ++static const int RicohDeviceIdOID[] = { 1,3,6,1,4,1,367,3,2,1,1,1,11,0,-1 }; + static const int XeroxProductOID[] = { 1,3,6,1,4,1,128,2,1,3,1,2,0,-1 }; + static cups_array_t *DeviceURIs = NULL; + static int HostNameLookups = 0; +@@ -969,9 +971,15 @@ read_snmp_response(int fd) /* I - SNMP socket file descriptor */ + _cupsSNMPWrite(fd, &(packet.address), CUPS_SNMP_VERSION_1, + packet.community, CUPS_ASN1_GET_REQUEST, + DEVICE_ID, LexmarkDeviceIdOID); ++ _cupsSNMPWrite(fd, &(packet.address), CUPS_SNMP_VERSION_1, ++ packet.community, CUPS_ASN1_GET_REQUEST, ++ DEVICE_ID, RicohDeviceIdOID); + _cupsSNMPWrite(fd, &(packet.address), CUPS_SNMP_VERSION_1, + packet.community, CUPS_ASN1_GET_REQUEST, + DEVICE_PRODUCT, XeroxProductOID); ++ _cupsSNMPWrite(fd, &(packet.address), CUPS_SNMP_VERSION_1, ++ packet.community, CUPS_ASN1_GET_REQUEST, ++ DEVICE_ID, HPDeviceIdOID); + break; + + case DEVICE_DESCRIPTION : +-- +2.26.2 + diff --git a/cups-hp-deviceid-oid.patch b/cups-hp-deviceid-oid.patch deleted file mode 100644 index da5136a..0000000 --- a/cups-hp-deviceid-oid.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -up cups-1.5b1/backend/snmp.c.hp-deviceid-oid cups-1.5b1/backend/snmp.c ---- cups-1.5b1/backend/snmp.c.hp-deviceid-oid 2011-05-20 05:49:49.000000000 +0200 -+++ cups-1.5b1/backend/snmp.c 2011-05-24 17:24:48.000000000 +0200 -@@ -187,6 +187,7 @@ static const int UriOID[] = { CUPS_OID_p - static const int LexmarkProductOID[] = { 1,3,6,1,4,1,641,2,1,2,1,2,1,-1 }; - static const int LexmarkProductOID2[] = { 1,3,6,1,4,1,674,10898,100,2,1,2,1,2,1,-1 }; - static const int LexmarkDeviceIdOID[] = { 1,3,6,1,4,1,641,2,1,2,1,3,1,-1 }; -+static const int HPDeviceIdOID[] = { 1,3,6,1,4,1,11,2,3,9,1,1,7,0,-1 }; - static const int XeroxProductOID[] = { 1,3,6,1,4,1,128,2,1,3,1,2,0,-1 }; - static cups_array_t *DeviceURIs = NULL; - static int HostNameLookups = 0; -@@ -1006,6 +1007,9 @@ read_snmp_response(int fd) /* I - SNMP - _cupsSNMPWrite(fd, &(packet.address), CUPS_SNMP_VERSION_1, - packet.community, CUPS_ASN1_GET_REQUEST, - DEVICE_PRODUCT, XeroxProductOID); -+ _cupsSNMPWrite(fd, &(packet.address), CUPS_SNMP_VERSION_1, -+ packet.community, CUPS_ASN1_GET_REQUEST, -+ DEVICE_ID, HPDeviceIdOID); - break; - - case DEVICE_DESCRIPTION : diff --git a/cups-ricoh-deviceid-oid.patch b/cups-ricoh-deviceid-oid.patch deleted file mode 100644 index c148f95..0000000 --- a/cups-ricoh-deviceid-oid.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -up cups-1.5b1/backend/snmp.c.ricoh-deviceid-oid cups-1.5b1/backend/snmp.c ---- cups-1.5b1/backend/snmp.c.ricoh-deviceid-oid 2011-05-24 17:29:48.000000000 +0200 -+++ cups-1.5b1/backend/snmp.c 2011-05-24 17:29:48.000000000 +0200 -@@ -188,6 +188,7 @@ static const int LexmarkProductOID[] = { - static const int LexmarkProductOID2[] = { 1,3,6,1,4,1,674,10898,100,2,1,2,1,2,1,-1 }; - static const int LexmarkDeviceIdOID[] = { 1,3,6,1,4,1,641,2,1,2,1,3,1,-1 }; - static const int HPDeviceIdOID[] = { 1,3,6,1,4,1,11,2,3,9,1,1,7,0,-1 }; -+static const int RicohDeviceIdOID[] = { 1,3,6,1,4,1,367,3,2,1,1,1,11,0,-1 }; - static const int XeroxProductOID[] = { 1,3,6,1,4,1,128,2,1,3,1,2,0,-1 }; - static cups_array_t *DeviceURIs = NULL; - static int HostNameLookups = 0; -@@ -1005,6 +1006,9 @@ read_snmp_response(int fd) /* I - SNMP - packet.community, CUPS_ASN1_GET_REQUEST, - DEVICE_ID, LexmarkDeviceIdOID); - _cupsSNMPWrite(fd, &(packet.address), CUPS_SNMP_VERSION_1, -+ packet.community, CUPS_ASN1_GET_REQUEST, -+ DEVICE_ID, RicohDeviceIdOID); -+ _cupsSNMPWrite(fd, &(packet.address), CUPS_SNMP_VERSION_1, - packet.community, CUPS_ASN1_GET_REQUEST, - DEVICE_PRODUCT, XeroxProductOID); - _cupsSNMPWrite(fd, &(packet.address), CUPS_SNMP_VERSION_1, diff --git a/cups.spec b/cups.spec index 8784326..41a0800 100644 --- a/cups.spec +++ b/cups.spec @@ -46,11 +46,6 @@ Patch7: cups-driverd-timeout.patch Patch9: cups-usb-paperout.patch # uri compatibility with old Fedoras Patch10: cups-uri-compat.patch -# fixing snmp oid for hp printer - upstream doesn't want to support too much -# snmp backend, because it's deprecated -Patch11: cups-hp-deviceid-oid.patch -# same as HP OID -Patch12: cups-ricoh-deviceid-oid.patch # change to notify type, because when it fails to start, it gives a error # message + renaming org.cups.cupsd names, because we have cups units in # in older Fedoras @@ -84,6 +79,8 @@ Patch22: cups-autostart-when-enabled.patch Patch100: cups-lspp.patch #### UPSTREAM PATCHES #### +# fixing snmp oid for hp and ricoh printers - taken from upstream +Patch11: 0001-Let-snmp-backend-also-use-manufacturer-specific-MIBs.patch # needed for correct color support of Canon printers, which # reports better options in print-color-mode-supported than # in pwg-raster-document-type-supported @@ -287,9 +284,7 @@ to CUPS daemon. This solution will substitute printer drivers and raw queues in # Allow the usb backend to understand old-style URI formats. %patch10 -p1 -b .uri-compat # Add an SNMP query for HP's device ID OID (STR #3552). -%patch11 -p1 -b .hp-deviceid-oid -# Add an SNMP query for Ricoh's device ID OID (STR #3552). -%patch12 -p1 -b .ricoh-deviceid-oid +%patch11 -p1 -b .deviceid-oid # Make cups.service Type=notify (bug #1088918). %patch13 -p1 -b .systemd-socket # Use IP_FREEBIND socket option when binding listening sockets (bug #970809). @@ -739,6 +734,7 @@ rm -f %{cups_serverbin}/backend/smb - remove old scripts for older migrations - CREDITS is now in markdown format, so we don't need to convert - fix requires on nss-mdns for cups-printerapp +- take SNMP OID from upstream * Thu Nov 12 2020 Zdenek Dohnal - 1:2.3.3-19 - 1897023 - Cups service restart sequence during upgrade incorrect