From 1a00383cfe0d7c282d79cab9dd36601e8c6678a6 Mon Sep 17 00:00:00 2001 From: Denis Silakov Date: Tue, 24 Jun 2014 15:13:53 +0400 Subject: [PATCH] Updated to 3.14.3 (sync with cooker) --- .abf.yml | 5 +- hplip-3.13.10-fix-udev-rules.patch | 12 +++ hplip-logdir.patch | 142 ++--------------------------- hplip-tmpfiles.conf | 1 + hplip-udev-rules.patch | 16 ++-- hplip.spec | 14 ++- 6 files changed, 36 insertions(+), 154 deletions(-) create mode 100644 hplip-3.13.10-fix-udev-rules.patch create mode 100644 hplip-tmpfiles.conf diff --git a/.abf.yml b/.abf.yml index 2599129..44fd220 100644 --- a/.abf.yml +++ b/.abf.yml @@ -1,7 +1,4 @@ -removed_sources: - hplip-3.13.10.tar.gz: 8c570ea4ed64a7e1a199f70de0f72178e07de026 - hplip-3.13.8.tar.gz: c91fd5231e056f03dc7e715a84afcb13074364d1 sources: SmartInstallDisable-Tool.run: c82103aa609cd7e58f43b090266bb77216933937 hp-sendfax.png: 2201320c59c2eaba10abce5c40306c6461e79beb - hplip-3.13.11.tar.gz: 240dcaf52c75a23cd5ab6a4426364245e7c2474e + hplip-3.14.3.tar.gz: c98727aea1ff2da273469edcf9b07751b1e194cd diff --git a/hplip-3.13.10-fix-udev-rules.patch b/hplip-3.13.10-fix-udev-rules.patch new file mode 100644 index 0000000..7a3f75f --- /dev/null +++ b/hplip-3.13.10-fix-udev-rules.patch @@ -0,0 +1,12 @@ +--- hplip-3.13.10/data/rules/56-hpmud_sysfs.rules 2013-10-11 09:38:53.000000000 +0000 ++++ hplip-3.13.10/data/rules/56-hpmud_sysfs.rules.tpg 2013-10-19 11:15:57.196603385 +0000 +@@ -14,9 +14,6 @@ + # For RHEL 5, centos 5.. + ENV{hp_test}=="yes", PROGRAM="/bin/sh -c 'X=%k; X=$${X#usbdev}; B=$${X%%%%.*}; D=$${X#*.}; logger -p user.info loading HP Device $$B $$D; printf %%03i:%%03i $$B $$D'", RUN+="/bin/sh -c '/usr/bin/python hp-config_usb_printer %c '" + +-# This rule will add the printer and install plugin +-ENV{hp_test}=="yes", PROGRAM="/bin/sh -c 'logger -p user.info loading HP Device $env{BUSNUM} $env{DEVNUM}'", RUN+="/bin/sh -c 'if [ -f /usr/bin/systemctl ]; then /usr/bin/systemctl --no-block start hplip-printer@$env{BUSNUM}:$env{DEVNUM}.service; else /usr/bin/nohup /usr/bin/python /usr/bin/hp-config_usb_printer $env{BUSNUM}:$env{DEVNUM} ; fi'" +- + # If sane-bankends is installed add hpaio backend support to dll.conf if needed. + ENV{sane_hpaio}=="yes", RUN+="/bin/sh -c 'grep -q ^#hpaio /etc/sane.d/dll.conf;if [ $$? -eq 0 ];then sed -i -e s/^#hpaio/hpaio/ /etc/sane.d/dll.conf;else grep -q ^hpaio /etc/sane.d/dll.conf;if [ $$? -ne 0 ];then echo hpaio >>/etc/sane.d/dll.conf;fi;fi'" + diff --git a/hplip-logdir.patch b/hplip-logdir.patch index 318956c..0ea1131 100644 --- a/hplip-logdir.patch +++ b/hplip-logdir.patch @@ -1,146 +1,22 @@ -diff -up hplip-3.13.5/prnt/hpcups/HPCupsFilter.cpp.logdir hplip-3.13.5/prnt/hpcups/HPCupsFilter.cpp ---- hplip-3.13.5/prnt/hpcups/HPCupsFilter.cpp.logdir 2013-05-14 14:57:19.450942281 +0200 -+++ hplip-3.13.5/prnt/hpcups/HPCupsFilter.cpp 2013-05-14 14:59:45.745927028 +0200 -@@ -31,6 +31,7 @@ - \*****************************************************************************/ - - #include "HPCupsFilter.h" -+#include - #include - #include - #include -@@ -610,10 +617,11 @@ int HPCupsFilter::processRasterData(cups - DRIVER_ERROR err; - int ret_status = 0; - -- char hpPreProcessedRasterFile[64]; //temp file needed to store raster data with swaped pages. -+ char hpPreProcessedRasterFile[PATH_MAX]; //temp file needed to store raster data with swaped pages. +--- hplip-3.14.3/prnt/hpcups/HPCupsFilter.cpp.logdir 2014-04-01 20:32:41.175022619 +0200 ++++ hplip-3.14.3/prnt/hpcups/HPCupsFilter.cpp 2014-04-01 20:33:58.726020660 +0200 +@@ -604,7 +605,7 @@ int HPCupsFilter::processRasterData(cups + char hpPreProcessedRasterFile[MAX_FILE_PATH_LEN]; //temp file needed to store raster data with swaped pages. - sprintf(hpPreProcessedRasterFile, "%s/hp_%s_cups_SwapedPagesXXXXXX",CUPS_TMP_DIR, m_JA.user_name); -+ snprintf(hpPreProcessedRasterFile, sizeof (hpPreProcessedRasterFile), -+ "%s/hp_%s_cups_SwapedPagesXXXXXX",CUPS_TMP_DIR, m_JA.user_name); ++ snprintf(hpPreProcessedRasterFile, sizeof(hpPreProcessedRasterFile), "%s/hp_%s_cups_SwapedPagesXXXXXX",CUPS_TMP_DIR, m_JA.user_name); while (cupsRasterReadHeader2(cups_raster, &cups_header)) -@@ -675,7 +683,7 @@ int HPCupsFilter::processRasterData(cups - // Save Raster file for Debugging - if (m_iLogLevel & SAVE_INPUT_RASTERS) - { -- char szFileName[64]; -+ char szFileName[PATH_MAX]; - memset(szFileName, 0, sizeof(szFileName)); - - if (cups_header.cupsColorSpace == CUPS_CSPACE_RGBW || -diff -up hplip-3.13.5/prnt/hpcups/LJZjStream.cpp.logdir hplip-3.13.5/prnt/hpcups/LJZjStream.cpp ---- hplip-3.13.5/prnt/hpcups/LJZjStream.cpp.logdir 2013-05-10 12:03:36.000000000 +0200 -+++ hplip-3.13.5/prnt/hpcups/LJZjStream.cpp 2013-05-14 14:57:19.460942143 +0200 -@@ -42,6 +42,7 @@ - #include "Utils.h" - #include "hpjbig_wrapper.h" - #include "utils.h" -+#include - - #define ZJC_BAND_HEIGHT 100 - -@@ -675,8 +678,8 @@ DRIVER_ERROR LJZjStream::preProcessRaste - cups_raster_t *even_pages_raster=NULL; - cups_raster_t *odd_pages_raster = NULL; - BYTE* pPageDataBuffer = NULL; -- char hpEvenPagesFile[64]={0,}; -- char hpOddPagesFile[64]={0,}; -+ char hpEvenPagesFile[PATH_MAX]={0,}; -+ char hpOddPagesFile[PATH_MAX]={0,}; - snprintf(hpEvenPagesFile, sizeof(hpEvenPagesFile), "%s/hp_%s_cups_EvenPagesXXXXXX",CUPS_TMP_DIR, m_pJA->user_name); - snprintf(hpOddPagesFile, sizeof(hpOddPagesFile), "%s/hp_%s_cups_OddPagesXXXXXX", CUPS_TMP_DIR, m_pJA->user_name); - -diff -up hplip-3.13.5/prnt/hpcups/SystemServices.cpp.logdir hplip-3.13.5/prnt/hpcups/SystemServices.cpp ---- hplip-3.13.5/prnt/hpcups/SystemServices.cpp.logdir 2013-05-10 12:03:36.000000000 +0200 -+++ hplip-3.13.5/prnt/hpcups/SystemServices.cpp 2013-05-14 14:57:19.460942143 +0200 -@@ -31,14 +31,15 @@ - #include "CommonDefinitions.h" - #include "SystemServices.h" - #include "utils.h" -+#include - - SystemServices::SystemServices(int iLogLevel, int job_id, char* user_name) : m_iLogLevel(iLogLevel) - { - m_fp = NULL; +--- hplip-3.14.3/prnt/hpcups/SystemServices.cpp.logdir 2014-04-01 20:32:41.182022618 +0200 ++++ hplip-3.14.3/prnt/hpcups/SystemServices.cpp 2014-04-01 20:34:56.574019199 +0200 +@@ -38,7 +38,7 @@ SystemServices::SystemServices(int iLogL if (iLogLevel & SAVE_PCL_FILE) { -- char fname[64]; + char fname[MAX_FILE_PATH_LEN]; - sprintf(fname, "%s/hp_%s_cups_out_job%d_XXXXXX",CUPS_TMP_DIR, user_name, job_id); -+ char fname[PATH_MAX]; + snprintf(fname, sizeof(fname), "%s/hp_%s_cups_out_job%d_XXXXXX",CUPS_TMP_DIR, user_name, job_id); createTempFile(fname, &m_fp); if (m_fp) -diff -up hplip-3.13.5/prnt/hpijs/hpcupsfax.cpp.logdir hplip-3.13.5/prnt/hpijs/hpcupsfax.cpp ---- hplip-3.13.5/prnt/hpijs/hpcupsfax.cpp.logdir 2013-05-10 12:04:54.000000000 +0200 -+++ hplip-3.13.5/prnt/hpijs/hpcupsfax.cpp 2013-05-14 14:57:19.461942130 +0200 -@@ -29,6 +29,7 @@ - POSSIBILITY OF SUCH DAMAGE. - \*****************************************************************************/ - -+#include - #include - #include - #include -@@ -440,7 +442,7 @@ int ProcessTiffData(int fromFD, int toFD - int bytes_written = 0; - int ret_status = 0; - int bytes_read = 0; -- char hpTiffFileName[64]; -+ char hpTiffFileName[PATH_MAX]; - long input_file_size = 0; - FILE* pFilePtrFax; - snprintf(hpTiffFileName,sizeof(hpTiffFileName), "%s/hp_%s_fax_tiffXXXXXX",CUPS_TMP_DIR,user_name); -diff -up hplip-3.13.5/prnt/hpijs/hpijs.cpp.logdir hplip-3.13.5/prnt/hpijs/hpijs.cpp ---- hplip-3.13.5/prnt/hpijs/hpijs.cpp.logdir 2013-05-14 14:57:19.448942309 +0200 -+++ hplip-3.13.5/prnt/hpijs/hpijs.cpp 2013-05-14 14:57:19.461942130 +0200 -@@ -29,6 +29,7 @@ - POSSIBILITY OF SUCH DAMAGE. - \*****************************************************************************/ - -+#include - #include - #include - #include -@@ -97,7 +100,7 @@ void setLogLevel(UXServices *pSS) - - if (pSS->m_iLogLevel & SAVE_PCL_FILE) - { -- char szFileName[64]; -+ char szFileName[PATH_MAX]; - snprintf (szFileName,sizeof(szFileName), "%s/hp_%s_ijs_%d_XXXXXX", CUPS_TMP_DIR, user_name, getpid()); - createTempFile(szFileName, &pSS->outfp); - -@@ -629,7 +637,7 @@ int main (int argc, char *argv[], char * - setLogLevel(pSS, user_name); - - #ifdef CAPTURE -- char szCapOutFile[64]; -+ char szCapOutFile[PATH_MAX]; - snprintf(szCapOutFile, sizeof(szCapOutFile),"%s/hp_%s_ijs_capout_XXXXXX",CUPS_TMP_DIR, user_name); - if ((pSS->InitScript(szCapOutFile, TRUE)) != NO_ERROR) - BUG("unable to init capture"); -diff -up hplip-3.13.5/prnt/hpijs/hpijsfax.cpp.logdir hplip-3.13.5/prnt/hpijs/hpijsfax.cpp ---- hplip-3.13.5/prnt/hpijs/hpijsfax.cpp.logdir 2013-05-10 12:04:54.000000000 +0200 -+++ hplip-3.13.5/prnt/hpijs/hpijsfax.cpp 2013-05-14 14:57:19.462942116 +0200 -@@ -31,6 +31,7 @@ - - #ifdef HAVE_LIBHPIP - -+#include - #include - #include - #include -@@ -272,7 +273,7 @@ int hpijsFaxServer (int argc, char **arg - IP_HANDLE hJob; - FILE *pFilePtrFax; - -- char hpFileName[64]; -+ char hpFileName[PATH_MAX]; - int fdFax = -1; - BYTE szFileHeader[68]; - BYTE szPageHeader[64]; diff --git a/hplip-tmpfiles.conf b/hplip-tmpfiles.conf new file mode 100644 index 0000000..0629533 --- /dev/null +++ b/hplip-tmpfiles.conf @@ -0,0 +1 @@ +d /run/hplip 0755 root root - diff --git a/hplip-udev-rules.patch b/hplip-udev-rules.patch index da6a877..80128dd 100644 --- a/hplip-udev-rules.patch +++ b/hplip-udev-rules.patch @@ -1,7 +1,6 @@ -diff -up hplip-3.13.6/Makefile.in.udev-rules hplip-3.13.6/Makefile.in ---- hplip-3.13.6/Makefile.in.udev-rules 2013-06-24 10:28:19.868301356 +0200 -+++ hplip-3.13.6/Makefile.in 2013-06-24 10:32:21.272134161 +0200 -@@ -4371,7 +4371,7 @@ cups_drv = prnt/drv/hpcups.drv +--- hplip-3.14.3/Makefile.in.udev-rules 2014-03-06 06:11:18.000000000 +0100 ++++ hplip-3.14.3/Makefile.in 2014-04-01 20:36:51.864016287 +0200 +@@ -4442,7 +4442,7 @@ cups_drv = prnt/drv/hpcups.drv @HPLIP_BUILD_TRUE@dist_rulessystem_DATA = data/rules/hplip-printer@.service # hpmud.rules @@ -10,15 +9,14 @@ diff -up hplip-3.13.6/Makefile.in.udev-rules hplip-3.13.6/Makefile.in @HPLIP_BUILD_TRUE@@UDEV_SYSFS_RULES_FALSE@dist_rules_DATA = data/rules/56-hpmud.rules @HPLIP_BUILD_TRUE@@UDEV_SYSFS_RULES_TRUE@dist_rules_DATA = data/rules/56-hpmud_sysfs.rules @HPLIP_BUILD_TRUE@halpredir = /usr/share/hal/fdi/preprobe/10osvendor - ---- b/data/rules/56-hpmud.rules.old 2013-11-21 23:23:07.000000000 +0400 -+++ b/data/rules/56-hpmud.rules 2013-11-21 23:35:51.937475723 +0400 -@@ -11,9 +11,6 @@ +--- hplip-3.14.3/data/rules/56-hpmud.rules.udev-rules 2014-04-01 20:36:51.864016287 +0200 ++++ hplip-3.14.3/data/rules/56-hpmud.rules 2014-04-01 20:37:54.014014717 +0200 +@@ -11,9 +11,6 @@ LABEL="hpmud_usb_rules" ATTR{idVendor}=="03f0", ATTR{idProduct}=="????", OWNER="root", GROUP="lp", MODE="0664", ENV{sane_hpaio}="yes", ENV{libsane_matched}="yes", ENV{hp_test}="yes", ENV{ID_HPLIP}="1" -# This rule will add the printer and install plugin --ENV{hp_test}=="yes", PROGRAM="/bin/sh -c 'logger -p user.info loading HP Device $env{BUSNUM} $env{DEVNUM}'", RUN+="/bin/sh -c 'if [ -f /usr/bin/systemctl ]; then /usr/bin/systemctl --no-block start hplip-printer@$env{BUSNUM}:$env{DEVNUM}.service; else /usr/bin/nohup /usr/bin/hp-config_usb_printer $env{BUSNUM}:$env{DEVNUM} ; fi'" +-ENV{hp_test}=="yes", PROGRAM="/bin/sh -c 'logger -p user.info loading HP Device $env{BUSNUM} $env{DEVNUM}'", RUN+="/bin/sh -c 'if [ -f /usr/bin/systemctl ]; then /usr/bin/systemctl --no-block start hplip-printer@$env{BUSNUM}:$env{DEVNUM}.service; else /usr/bin/nohup /usr/bin/python /usr/bin/hp-config_usb_printer $env{BUSNUM}:$env{DEVNUM} ; fi &'" - # If sane-bankends is installed add hpaio backend support to dll.conf if needed. ENV{sane_hpaio}=="yes", RUN+="/bin/sh -c 'grep -q ^#hpaio /etc/sane.d/dll.conf;if [ $$? -eq 0 ];then sed -i -e s/^#hpaio/hpaio/ /etc/sane.d/dll.conf;else grep -q ^hpaio /etc/sane.d/dll.conf;if [ $$? -ne 0 ];then echo hpaio >>/etc/sane.d/dll.conf;fi;fi'" diff --git a/hplip.spec b/hplip.spec index 808884a..0801c94 100644 --- a/hplip.spec +++ b/hplip.spec @@ -17,14 +17,14 @@ Summary: HP printer/all-in-one driver infrastructure Name: hplip -Version: 3.13.11 -Release: 26 +Version: 3.14.3 +Release: 4 License: GPLv2+ and MIT Group: System/Printing Url: http://hplip.sourceforge.net/ Source0: http://garr.dl.sourceforge.net/sourceforge/hplip/%{name}-%{version}%{extraversion}.tar.gz Source1: hpcups-update-ppds.sh -Source2: copy-deviceids.py +Source2: copy-deviceids.py # http://www.iconfinder.com/icondetails/6393/128/fax_hardware_icon Source3: hp-sendfax.png Source4: hplip.rpmlintrc @@ -36,7 +36,7 @@ Source6: README.urpmi Patch1: hplip-3.11.3-mdv-link.patch # (Anssi) Apply udev rules even on ACTION=="change", otherwise the permissions # do not get applied in %%post on a new installation: -Patch2: hplip-apply-udev-rules-on-action-change.patch +Patch2: hplip-apply-udev-rules-on-action-change.patch # Fedora patches Patch101: hplip-pstotiff-is-rubbish.patch @@ -81,7 +81,7 @@ Patch226: hp-systray-make-menu-title-visible-in-sni-qt-indicator.dpatch Patch227: hp-systray-make-menu-appear-in-sni-qt-indicator-with-kde.dpatch Patch228: hpaio-option-duplex.diff -Patch302: hplip-CVE-2013-4325.patch +Patch302: hplip-CVE-2013-4325.patch BuildRequires: desktop-file-utils BuildRequires: imagemagick @@ -611,9 +611,7 @@ EOF done %post -# We don't have this macro yes... -/bin/systemd-tmpfiles --create %{name}.conf -# tmpfiles_create %{name} +%tmpfiles_create %{name}.conf %post -n hplip-hpijs-ppds # Restart CUPS to make the printing PPDs known to it