[cups/f14] Fix SNMP supply level crasher (STR #3875, bug #719057).
Jiří Popelka
jpopelka at fedoraproject.org
Thu Jul 7 15:16:57 UTC 2011
commit 10829b97afb5f8eb982895a492ac9f26427eca87
Author: Jiri Popelka <jpopelka at redhat.com>
Date: Thu Jul 7 16:54:10 2011 +0200
Fix SNMP supply level crasher (STR #3875, bug #719057).
cups-str3875.patch | 15 +++++++++++++++
cups.spec | 8 +++++++-
2 files changed, 22 insertions(+), 1 deletions(-)
---
diff --git a/cups-str3875.patch b/cups-str3875.patch
new file mode 100644
index 0000000..7d90414
--- /dev/null
+++ b/cups-str3875.patch
@@ -0,0 +1,15 @@
+diff -up cups-1.4.7/backend/snmp-supplies.c.str3875 cups-1.4.7/backend/snmp-supplies.c
+--- cups-1.4.7/backend/snmp-supplies.c.str3875 2011-07-07 16:44:41.000000000 +0200
++++ cups-1.4.7/backend/snmp-supplies.c 2011-07-07 16:48:19.201008765 +0200
+@@ -259,7 +259,10 @@ backendSNMPSupplies(
+ if (quirks & QUIRK_CAPACITY)
+ supplies[i].max_capacity = 100;
+
+- percent = 100 * supplies[i].level / supplies[i].max_capacity;
++ if (supplies[i].max_capacity > 0)
++ percent = 100 * supplies[i].level / supplies[i].max_capacity;
++ else
++ percent = 50;
+
+ if (percent <= 10)
+ {
diff --git a/cups.spec b/cups.spec
index 065a4f3..afb478a 100644
--- a/cups.spec
+++ b/cups.spec
@@ -8,7 +8,7 @@
Summary: Common Unix Printing System
Name: cups
Version: 1.4.7
-Release: 4%{?dist}
+Release: 5%{?dist}
License: GPLv2
Group: System Environment/Daemons
Source: http://ftp.easysw.com/pub/cups/%{version}/cups-%{version}-source.tar.bz2
@@ -64,6 +64,7 @@ Patch30: cups-hp-deviceid-oid.patch
Patch31: cups-dnssd-deviceid.patch
Patch32: cups-ricoh-deviceid-oid.patch
Patch33: cups-texttops-rotate-page.patch
+Patch34: cups-str3875.patch
Patch100: cups-lspp.patch
@@ -262,6 +263,8 @@ module.
# This fixes page-label orientation when texttops is used in the
# filter chain (bug #572338).
%patch33 -p1 -b .texttops-rotate-page
+# Fix SNMP supply level crasher (STR #3875, bug #719057).
+%patch34 -p1 -b .str3875
%if %lspp
# LSPP support.
@@ -565,6 +568,9 @@ rm -rf $RPM_BUILD_ROOT
%{php_extdir}/phpcups.so
%changelog
+* Thu Jul 7 2011 Jiri Popelka <jpopelka at redhat.com> 1:1.4.7-5
+- Fix SNMP supply level crasher (STR #3875, bug #719057).
+
* Thu Jul 7 2011 Tim Waugh <twaugh at redhat.com> 1:1.4.7-4
- Undo last change which had no effect. We already remove the .SILENT
target from the Makefile as part of the build.
More information about the scm-commits
mailing list