diff --git a/cups-socket-snmp.patch b/cups-socket-snmp.patch new file mode 100644 index 0000000..efe9e27 --- /dev/null +++ b/cups-socket-snmp.patch @@ -0,0 +1,53 @@ +diff -up cups-1.4rc1/backend/socket.c.socket-snmp cups-1.4rc1/backend/socket.c +--- cups-1.4rc1/backend/socket.c.socket-snmp 2009-03-03 20:29:23.000000000 +0000 ++++ cups-1.4rc1/backend/socket.c 2009-07-28 17:50:02.770752676 +0100 +@@ -78,6 +78,7 @@ main(int argc, /* I - Number of comm + int recoverable; /* Recoverable error shown? */ + int contimeout; /* Connection timeout */ + int waiteof; /* Wait for end-of-file? */ ++ int use_snmp; /* Whether to use SNMP */ + int port; /* Port number */ + char portname[255]; /* Port name */ + int delay; /* Delay for retries... */ +@@ -182,6 +183,7 @@ main(int argc, /* I - Number of comm + + waiteof = 1; + contimeout = 7 * 24 * 60 * 60; ++ use_snmp = 1; + + if ((options = strchr(resource, '?')) != NULL) + { +@@ -249,6 +251,15 @@ main(int argc, /* I - Number of comm + if (atoi(value) > 0) + contimeout = atoi(value); + } ++ else if (!strcasecmp(name, "snmp")) ++ { ++ /* ++ * Set whether SNMP is allowed... ++ */ ++ ++ use_snmp = (!value[0] || !strcasecmp(value, "on") || ++ !strcasecmp(value, "yes") || !strcasecmp(value, "true")); ++ } + } + } + +@@ -373,13 +384,16 @@ main(int argc, /* I - Number of comm + * See if the printer supports SNMP... + */ + +- if ((snmp_fd = _cupsSNMPOpen(addr->addr.addr.sa_family)) >= 0) ++ if (use_snmp && (snmp_fd = _cupsSNMPOpen(addr->addr.addr.sa_family)) >= 0) + { + have_supplies = !backendSNMPSupplies(snmp_fd, &(addr->addr), &start_count, + NULL); + } + else ++ { + have_supplies = start_count = 0; ++ snmp_fd = -1; ++ } + + /* + * Print everything... diff --git a/cups.spec b/cups.spec index eed0722..71d3116 100644 --- a/cups.spec +++ b/cups.spec @@ -58,7 +58,8 @@ Patch31: cups-str3254.patch Patch32: cups-str3253.patch Patch33: cups-str3266.patch Patch34: cups-str3262.patch -Patch35: cups-avahi.patch +Patch35: cups-socket-snmp.patch +Patch36: cups-avahi.patch Patch100: cups-lspp.patch Epoch: 1 Url: http://www.cups.org/ @@ -214,7 +215,8 @@ module. %patch32 -p1 -b .str3253 %patch33 -p1 -b .str3266 %patch34 -p1 -b .str3262 -#%patch35 -p1 -b .avahi +%patch35 -p1 -b .socket-snmp +#%patch36 -p1 -b .avahi %if %lspp %patch100 -p1 -b .lspp @@ -508,6 +510,7 @@ rm -rf $RPM_BUILD_ROOT %changelog * Tue Jul 28 2009 Tim Waugh 1:1.4-0.rc1.11 +- Temporarily added snmp option to socket backend for debugging purposes. - Prevent ipp backend looping with bad IPP devices (bug #476424, STR #3262). - Fixed Device ID reporting in the usb backend (STR #3266).