From f0558cd5ca62974fe4127ed7d00e862bd14558ef Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Fri, 16 Apr 2010 18:47:04 +0000 Subject: [PATCH] - Mark DNS-SD Device IDs that have been guessed at with "FZY:1;". --- cups-dnssd-deviceid.patch | 38 ++++++++++++++++++++++++++++++++++++++ cups.spec | 8 +++++++- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 cups-dnssd-deviceid.patch diff --git a/cups-dnssd-deviceid.patch b/cups-dnssd-deviceid.patch new file mode 100644 index 0000000..abb8366 --- /dev/null +++ b/cups-dnssd-deviceid.patch @@ -0,0 +1,38 @@ +diff -up cups-1.4.3/backend/dnssd.c.dnssd-deviceid.patch cups-1.4.3/backend/dnssd.c +--- cups-1.4.3/backend/dnssd.c.dnssd-deviceid.patch 2010-04-16 19:36:12.226148774 +0100 ++++ cups-1.4.3/backend/dnssd.c 2010-04-16 19:39:53.314148240 +0100 +@@ -1192,15 +1192,22 @@ find_device (cups_array_t *devices, + if (device->device_id) + free(device->device_id); + ++ if (device_id[0]) ++ { ++ /* Mark this as the real device ID. */ ++ ptr = device_id + strlen(device_id); ++ snprintf(ptr, sizeof(device_id) - (ptr - device_id), "FZY:0;"); ++ } ++ + if (!device_id[0] && strcmp(model, "Unknown")) + { + if (make_and_model[0]) +- snprintf(device_id, sizeof(device_id), "MFG:%s;MDL:%s;", ++ snprintf(device_id, sizeof(device_id), "MFG:%s;MDL:%s;FZY:1;", + make_and_model, model); + else if (!strncasecmp(model, "designjet ", 10)) +- snprintf(device_id, sizeof(device_id), "MFG:HP;MDL:%s", model + 10); ++ snprintf(device_id, sizeof(device_id), "MFG:HP;MDL:%s;FZY:1;", model + 10); + else if (!strncasecmp(model, "stylus ", 7)) +- snprintf(device_id, sizeof(device_id), "MFG:EPSON;MDL:%s", model + 7); ++ snprintf(device_id, sizeof(device_id), "MFG:EPSON;MDL:%s;FZY:1;", model + 7); + else if ((ptr = strchr(model, ' ')) != NULL) + { + /* +@@ -1210,7 +1217,7 @@ find_device (cups_array_t *devices, + memcpy(make_and_model, model, ptr - model); + make_and_model[ptr - model] = '\0'; + +- snprintf(device_id, sizeof(device_id), "MFG:%s;MDL:%s", ++ snprintf(device_id, sizeof(device_id), "MFG:%s;MDL:%s;FZY:1;", + make_and_model, ptr + 1); + } + } diff --git a/cups.spec b/cups.spec index 5577d0a..a3fe098 100644 --- a/cups.spec +++ b/cups.spec @@ -8,7 +8,7 @@ Summary: Common Unix Printing System Name: cups Version: 1.4.3 -Release: 5%{?dist} +Release: 6%{?dist} License: GPLv2 Group: System Environment/Daemons Source: http://ftp.easysw.com/pub/cups/%{version}/cups-%{version}-source.tar.bz2 @@ -65,6 +65,7 @@ Patch31: cups-str3505.patch Patch32: cups-str3541.patch Patch33: cups-snmp-quirks.patch Patch34: cups-hp-deviceid-oid.patch +Patch35: cups-dnssd-deviceid.patch Patch100: cups-lspp.patch @@ -268,6 +269,8 @@ module. %patch33 -p1 -b .snmp-quirks # Add an SNMP query for HP's device ID OID (STR #3552). %patch34 -p1 -b .hp-deviceid-oid +# Mark DNS-SD Device IDs that have been guessed at with "FZY:1;". +%patch35 -p1 -b .dnssd-deviceid %if %lspp # LSPP support. @@ -568,6 +571,9 @@ rm -rf $RPM_BUILD_ROOT %{php_extdir}/phpcups.so %changelog +* Fri Apr 16 2010 Tim Waugh 1:1.4.3-6 +- Mark DNS-SD Device IDs that have been guessed at with "FZY:1;". + * Fri Apr 16 2010 Jiri Popelka 1:1.4.3-5 - Fixed str3541.patch