diff --git a/hplip-segfault.patch b/hplip-segfault.patch new file mode 100644 index 0000000..84a8176 --- /dev/null +++ b/hplip-segfault.patch @@ -0,0 +1,19 @@ +diff -up hplip-2.8.12/prnt/hpijs/hpijs.cpp.segfault hplip-2.8.12/prnt/hpijs/hpijs.cpp +--- hplip-2.8.12/prnt/hpijs/hpijs.cpp.segfault 2009-01-13 15:11:55.000000000 +0000 ++++ hplip-2.8.12/prnt/hpijs/hpijs.cpp 2009-01-13 15:13:49.000000000 +0000 +@@ -231,8 +231,14 @@ int hpijs_set_cb (void *set_cb_data, Ijs + // call dbus here + const char *user_name = " "; + const char *title = " "; ++ char *device_uri = getenv ("DEVICE_URI"); ++ char *printer = getenv("PRINTER"); + int job_id = 0; +- SendDbusMessage (getenv ("DEVICE_URI"), getenv("PRINTER"), ++ if (!device_uri) ++ device_uri = ""; ++ if (!printer) ++ printer = ""; ++ SendDbusMessage (device_uri, printer, + EVENT_PRINT_FAILED_MISSING_PLUGIN, + user_name, job_id, title); + bug("unable to set device=%s, err=%d\n", svalue, r); diff --git a/hplip.spec b/hplip.spec index dc72ad8..2e26bba 100644 --- a/hplip.spec +++ b/hplip.spec @@ -1,7 +1,7 @@ Summary: HP Linux Imaging and Printing Project Name: hplip Version: 2.8.12 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv2+ and MIT Group: System Environment/Daemons Conflicts: system-config-printer < 0.6.132 @@ -15,6 +15,7 @@ Url: http://hplip.sourceforge.net/ Source0: http://kent.dl.sourceforge.net/sourceforge/hplip/%{name}-%{version}.tar.gz Source1: hplip.fdi Patch1: hplip-desktop.patch +Patch2: hplip-segfault.patch Patch4: hplip-marker-supply.patch Patch5: hplip-dbus.patch Patch6: hplip-systray.patch @@ -104,6 +105,10 @@ rm -rf $RPM_BUILD_DIR/%{name}-%{version} # Fix desktop file. %patch1 -p1 -b .desktop +# Prevent crash when DEVICE_URI/PRINTER environment variables are not +# set (bug #479808 comment 6). +%patch2 -p1 -b .segfault + # Low ink is a warning condition, not an error. %patch4 -p1 -b .marker-supply @@ -317,6 +322,10 @@ fi exit 0 %changelog +* Tue Jan 13 2009 Tim Waugh 2.8.12-4 +- Prevent crash when DEVICE_URI/PRINTER environment variables are not + set (bug #479808 comment 6). + * Tue Jan 13 2009 Tim Waugh 2.8.12-3 - Make --qt4 the default for the systray applet, so that it appears in the right place, again (bug #479751).