From 90831de7d093246cdf7f3aeac0a0be23819d0a8e Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Thu, 11 Dec 2008 11:13:33 +0000 Subject: [PATCH] - Prevent backend crash when D-Bus not running (bug #474362). --- hplip-dbus.patch | 13 +++++++++++++ hplip.spec | 9 ++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 hplip-dbus.patch diff --git a/hplip-dbus.patch b/hplip-dbus.patch new file mode 100644 index 0000000..891a1bd --- /dev/null +++ b/hplip-dbus.patch @@ -0,0 +1,13 @@ +diff -up hplip-2.8.7/prnt/backend/hp.c.dbus hplip-2.8.7/prnt/backend/hp.c +--- hplip-2.8.7/prnt/backend/hp.c.dbus 2008-12-11 10:44:30.000000000 +0000 ++++ hplip-2.8.7/prnt/backend/hp.c 2008-12-11 10:46:15.000000000 +0000 +@@ -489,6 +489,9 @@ static int device_event(const char *dev, + DBusMessage * msg = NULL; + int id = atoi(jobid); + ++ if (dbus_conn == NULL) ++ return 0; ++ + msg = dbus_message_new_signal(DBUS_PATH, DBUS_INTERFACE, "Event"); + + if (NULL == msg) diff --git a/hplip.spec b/hplip.spec index 7f55d96..e136760 100644 --- a/hplip.spec +++ b/hplip.spec @@ -1,7 +1,7 @@ Summary: HP Linux Imaging and Printing Project Name: hplip Version: 2.8.7 -Release: 4%{?dist} +Release: 5%{?dist} License: GPLv2+ and MIT Group: System Environment/Daemons Conflicts: system-config-printer < 0.6.132 @@ -18,6 +18,7 @@ Patch1: hplip-desktop.patch Patch2: hplip-gzip-n.patch Patch3: hplip-quiet.patch Patch4: hplip-marker-supply.patch +Patch5: hplip-dbus.patch Patch6: hplip-systray.patch Patch8: hplip-libsane.patch Patch12: hplip-no-root-config.patch @@ -114,6 +115,9 @@ rm -rf $RPM_BUILD_DIR/%{name}-%{version} # Low ink is a warning condition, not an error. %patch4 -p1 -b .marker-supply +# Prevent backend crash when D-Bus not running (bug #474362). +%patch5 -p1 -b .dbus + # Make --qt4 the default for the systray applet, so that it appears # in the right place. %patch6 -p1 -b .systray @@ -306,6 +310,9 @@ fi exit 0 %changelog +* Thu Dec 11 2008 Tim Waugh 2.8.7-5 +- Prevent backend crash when D-Bus not running (bug #474362). + * Sat Nov 29 2008 Ignacio Vazquez-Abrams - 2.8.7-4 - Rebuild for Python 2.6