diff --git a/.gitignore b/.gitignore index 027d13d..b21d8b3 100644 --- a/.gitignore +++ b/.gitignore @@ -59,3 +59,4 @@ hplip-3.10.6.tar.gz /hplip-3.13.7.tar.gz /hplip-3.13.8.tar.gz /hplip-3.13.9.tar.gz +/hplip-3.13.10.tar.gz diff --git a/hplip-3.13.10.tar.gz.asc b/hplip-3.13.10.tar.gz.asc new file mode 100644 index 0000000..d076bbb --- /dev/null +++ b/hplip-3.13.10.tar.gz.asc @@ -0,0 +1,7 @@ +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.11 (GNU/Linux) + +iEYEABECAAYFAlJXyTYACgkQc9dwzaWQR7lU3gCfUPYc+L4OhHfT6FyDR+p6Cc3f +nTQAoKVRl9zN6A2FEfuevhyXKvbvxS5X +=rBTR +-----END PGP SIGNATURE----- diff --git a/hplip-3.13.9.tar.gz.asc b/hplip-3.13.9.tar.gz.asc deleted file mode 100644 index 61303ee..0000000 --- a/hplip-3.13.9.tar.gz.asc +++ /dev/null @@ -1,7 +0,0 @@ ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.4.11 (GNU/Linux) - -iEYEABECAAYFAlIoR1sACgkQc9dwzaWQR7lohwCfaoxhATOoQn1B2kcsDZrx5FB5 -tMYAn35uKn+H5/feIApEUN+DKjeam1/x -=75MO ------END PGP SIGNATURE----- diff --git a/hplip-CVE-2013-4325.patch b/hplip-CVE-2013-4325.patch deleted file mode 100644 index 0bc246c..0000000 --- a/hplip-CVE-2013-4325.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -up hplip-3.13.7/base/pkit.py.CVE-2013-4325 hplip-3.13.7/base/pkit.py ---- hplip-3.13.7/base/pkit.py.CVE-2013-4325 2013-07-23 06:18:29.000000000 +0100 -+++ hplip-3.13.7/base/pkit.py 2013-09-11 10:54:13.252419283 +0100 -@@ -176,15 +176,10 @@ class PolicyKitService(dbus.service.Obje - "/org/freedesktop/PolicyKit1/Authority", - "org.freedesktop.PolicyKit1.Authority") - policy_kit = dbus.Interface(obj, "org.freedesktop.PolicyKit1.Authority") -- info = dbus.Interface(connection.get_object("org.freedesktop.DBus", -- "/org/freedesktop/DBus/Bus", -- False), -- "org.freedesktop.DBus") -- pid = info.GetConnectionUnixProcessID(sender) - - subject = ( -- 'unix-process', -- { 'pid' : dbus.UInt32(pid, variant_level = 1) } -+ 'system-bus-name', -+ { 'name' : dbus.String(sender, variant_level = 1) } - ) - details = { '' : '' } - flags = dbus.UInt32(1) # AllowUserInteraction = 0x00000001 diff --git a/hplip-addprinter.patch b/hplip-addprinter.patch deleted file mode 100644 index bcbb39e..0000000 --- a/hplip-addprinter.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -up hplip-3.12.9/prnt/cupsext/cupsext.c.addprinter hplip-3.12.9/prnt/cupsext/cupsext.c ---- hplip-3.12.9/prnt/cupsext/cupsext.c.addprinter 2012-09-04 14:31:10.000000000 +0200 -+++ hplip-3.12.9/prnt/cupsext/cupsext.c 2012-09-07 14:20:24.626193617 +0200 -@@ -511,6 +511,7 @@ PyObject * addPrinter( PyObject * self, - strcpy( info, name ); - - /* Connect to the HTTP server */ -+ cupsSetUser ("root"); - if ( ( http = httpConnectEncrypt( cupsServer(), ippPort(), cupsEncryption() ) ) == NULL ) - { - r = 0; diff --git a/hplip-check.patch b/hplip-check.patch deleted file mode 100644 index 5780961..0000000 --- a/hplip-check.patch +++ /dev/null @@ -1,39 +0,0 @@ -diff -up hplip-3.13.2/installer/core_install.py.check hplip-3.13.2/installer/core_install.py ---- hplip-3.13.2/installer/core_install.py.check 2013-02-14 14:10:20.000000000 +0100 -+++ hplip-3.13.2/installer/core_install.py 2013-02-14 14:12:05.759135292 +0100 -@@ -1026,18 +1026,23 @@ class CoreInstall(object): - - def check_hpaio(self): - found = False -- log.debug("'Checking for hpaio' in '/etc/sane.d/dll.conf'...") -- try: -- f = file('/etc/sane.d/dll.conf', 'r') -- except IOError: -- log.error("'/etc/sane.d/dll.conf' not found. Is SANE installed?") -- else: -- for line in f: -- lineNoSpace = re.sub(r'\s', '', line) -- hpaiomatched=re.match('hpaio',lineNoSpace) -- if hpaiomatched: -- found = True -- break -+ for path in ['/etc/sane.d/dll.conf', -+ '/etc/sane.d/dll.d/hpaio']: -+ log.debug("'Checking for hpaio' in '%s'..." % path) -+ try: -+ f = file(path, 'r') -+ except IOError: -+ log.error("'%s' not found. Is SANE installed?" % path) -+ else: -+ for line in f: -+ lineNoSpace = re.sub(r'\s', '', line) -+ hpaiomatched=re.match('hpaio',lineNoSpace) -+ if hpaiomatched: -+ found = True -+ break -+ -+ if found: -+ break - return found - - def update_hpaio(self): diff --git a/hplip-deviceIDs-drv.patch b/hplip-deviceIDs-drv.patch index 51642a6..42a1349 100644 --- a/hplip-deviceIDs-drv.patch +++ b/hplip-deviceIDs-drv.patch @@ -1604,6 +1604,15 @@ diff -up hplip-3.13.7/prnt/drv/hpcups.drv.in.deviceIDs-drv hplip-3.13.7/prnt/drv PCFileName "hp-laserjet_professional_p1102w.ppd" Attribute "Product" "" "(HP LaserJet Professional p1102w Printer)" } +@@ -16372,7 +16375,7 @@ Group "RLT/HP Real Life Technologies" + ModelName "HP LaserJet Professional p1102" + Attribute "NickName" "" "HP LaserJet Professional p1102, hpcups $Version, requires proprietary plugin" + Attribute "ShortNickName" "" "HP LaserJet Professional p1102" +- Attribute "1284DeviceID" "" "MFG:HP;MDL:hp laserjet professional p1102;DES:hp laserjet professional p1102;" ++ Attribute "1284DeviceID" "" "MFG:Hewlett-Packard;MDL:hp laserjet professional p1102;DES:hp laserjet professional p1102;" + PCFileName "hp-laserjet_professional_p1102.ppd" + Attribute "Product" "" "(HP LaserJet Professional p1102 Printer)" + Attribute "Product" "" "(HP LaserJet Professional p1102s Printer)" @@ -16494,7 +16497,7 @@ Group "RLT/HP Real Life Technologies" ModelName "HP LaserJet Professional m1212nf MFP" Attribute "NickName" "" "HP LaserJet Professional m1212nf MFP, hpcups $Version, requires proprietary plugin" diff --git a/hplip-discovery-method.patch b/hplip-discovery-method.patch deleted file mode 100644 index cb277a3..0000000 --- a/hplip-discovery-method.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -up hplip-3.9.8/ui4/setupdialog.py.discovery-method hplip-3.9.8/ui4/setupdialog.py ---- hplip-3.9.8/ui4/setupdialog.py.discovery-method 2009-08-04 22:37:22.000000000 +0100 -+++ hplip-3.9.8/ui4/setupdialog.py 2009-09-16 15:34:36.509431266 +0100 -@@ -171,6 +171,7 @@ class SetupDialog(QDialog, Ui_Dialog): - QTimer.singleShot(0, self.showRemovePage) - else: - if self.skip_discovery: -+ self.discovery_method = 1 # mDNS - QTimer.singleShot(0, self.showDevicesPage) - else: - QTimer.singleShot(0, self.showDiscoveryPage) diff --git a/hplip-hpaio-localonly.patch b/hplip-hpaio-localonly.patch deleted file mode 100644 index 0a315ba..0000000 --- a/hplip-hpaio-localonly.patch +++ /dev/null @@ -1,45 +0,0 @@ -diff -up hplip-3.11.10/scan/sane/hpaio.c~ hplip-3.11.10/scan/sane/hpaio.c ---- hplip-3.11.10/scan/sane/hpaio.c~ 2011-10-02 04:04:48.000000000 +0100 -+++ hplip-3.11.10/scan/sane/hpaio.c 2011-10-20 16:00:38.016534755 +0100 -@@ -272,25 +272,28 @@ static int DevDiscovery(int localOnly) - } - } - -- /* Ignore localOnly flag (used by saned) and always look for network all-in-one scan devices (defined by cups). */ -- cnt = GetCupsPrinters(&cups_printer); -- for (i=0; i 0) -- { -+ cnt = GetCupsPrinters(&cups_printer); -+ for (i=0; i 0) -+ { - hpmud_get_uri_model(cups_printer[i], model, sizeof(model)); - AddDeviceList(cups_printer[i], model, &DeviceList); - total++; -- } -- else -- { -+ } -+ else -+ { - DBG(6,"unsupported scantype=%d %s\n", ma.scantype, cups_printer[i]); -- } -- free(cups_printer[i]); -+ } -+ free(cups_printer[i]); -+ } -+ if (cups_printer) -+ free(cups_printer); - } -- if (cups_printer) -- free(cups_printer); - - bugout: - return total; diff --git a/hplip-hpijs-marker-supply.patch b/hplip-hpijs-marker-supply.patch index 3ae7c16..ff0713e 100644 --- a/hplip-hpijs-marker-supply.patch +++ b/hplip-hpijs-marker-supply.patch @@ -6,9 +6,9 @@ diff -up hplip-3.10.9/prnt/hpijs/hpijs.cpp.hpijs-marker-supply hplip-3.10.9/prnt int status = EXIT_FAILURE; int ret, n, i, kn=0, width, k_width; + int low_marker = 0; - + char user_name[32]={0,}; + openlog("hpijs", LOG_PID, LOG_DAEMON); - @@ -666,14 +667,17 @@ int main (int argc, char *argv[], char * case WARN_LOW_INK_YELLOW: case WARN_LOW_INK_MULTIPLE_PENS: diff --git a/hplip-logdir.patch b/hplip-logdir.patch index 807c66a..318956c 100644 --- a/hplip-logdir.patch +++ b/hplip-logdir.patch @@ -1,79 +1,29 @@ -diff -up hplip-3.13.5/fax/backend/hpfax.py.logdir hplip-3.13.5/fax/backend/hpfax.py ---- hplip-3.13.5/fax/backend/hpfax.py.logdir 2013-05-10 12:09:22.000000000 +0200 -+++ hplip-3.13.5/fax/backend/hpfax.py 2013-05-14 14:57:19.458942171 +0200 -@@ -244,7 +244,7 @@ else: - input_fd = 0 - - # REVISIT: -- tmp_dir = '/var/log/hp/tmp' -+ tmp_dir = "/var/run/hplip" - - - pipe_name = os.path.join(tmp_dir, "hpfax-pipe-%d" % job_id) -diff -up hplip-3.13.5/logcapture.py.logdir hplip-3.13.5/logcapture.py ---- hplip-3.13.5/logcapture.py.logdir 2013-05-10 12:09:32.000000000 +0200 -+++ hplip-3.13.5/logcapture.py 2013-05-14 14:57:19.458942171 +0200 -@@ -39,7 +39,7 @@ CUPS_BACKUP_FILE='/etc/cups/cupsd.conf_o - LOG_FOLDER_PATH='./' - LOG_FOLDER_NAME='hplip_troubleshoot_logs' - LOG_FILES=LOG_FOLDER_PATH + LOG_FOLDER_NAME --TMP_DIR='/var/log/hp/tmp' -+TMP_DIR='/var/spool/cups/tmp' - ############ enable_log() function ############ - #This function changes CUPS conf log level to debug and restarts CUPS service. - -@@ -266,7 +266,7 @@ if os.path.exists('/var/log/cups/error_l - if sts != 0: - log.error("Failed to capture %s log file."%("/var/log/cups/error_log")) - --File_list, File_list_str = utils.expand_list('/var/log/hp/*.log') -+File_list, File_list_str = utils.expand_list('%s/*.log'%TMP_DIR) - if File_list: - sts,out = utils.run('cp -f %s %s'%(File_list_str, LOG_FILES)) - if sts != 0: 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,7 +31,9 @@ +@@ -31,6 +31,7 @@ \*****************************************************************************/ #include "HPCupsFilter.h" +#include #include -+#include #include #include - #include -@@ -39,10 +41,15 @@ - - #define HP_FILE_VERSION_STR "03.09.08.0" - -+char *env_tmpdir = NULL; - static HPCupsFilter filter; - - int main (int argc, char *argv[]) - { -+ env_tmpdir = getenv ("TMPDIR"); -+ if (!env_tmpdir) -+ env_tmpdir = "/var/log/hp/tmp"; -+ - openlog("hpcups", LOG_PID, LOG_DAEMON); - - if (argc < 6 || argc > 7) { -@@ -610,9 +617,10 @@ int HPCupsFilter::processRasterData(cups +@@ -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. -- strcpy(hpPreProcessedRasterFile, "/var/log/hp/tmp/hplipSwapedPagesXXXXXX"); + +- sprintf(hpPreProcessedRasterFile, "%s/hp_%s_cups_SwapedPagesXXXXXX",CUPS_TMP_DIR, m_JA.user_name); + snprintf(hpPreProcessedRasterFile, sizeof (hpPreProcessedRasterFile), -+ "%s/hplipSwapedPagesXXXXXX", env_tmpdir); ++ "%s/hp_%s_cups_SwapedPagesXXXXXX",CUPS_TMP_DIR, m_JA.user_name); while (cupsRasterReadHeader2(cups_raster, &cups_header)) -@@ -675,14 +683,15 @@ int HPCupsFilter::processRasterData(cups +@@ -675,7 +683,7 @@ int HPCupsFilter::processRasterData(cups // Save Raster file for Debugging if (m_iLogLevel & SAVE_INPUT_RASTERS) { @@ -82,75 +32,46 @@ diff -up hplip-3.13.5/prnt/hpcups/HPCupsFilter.cpp.logdir hplip-3.13.5/prnt/hpcu memset(szFileName, 0, sizeof(szFileName)); if (cups_header.cupsColorSpace == CUPS_CSPACE_RGBW || - cups_header.cupsColorSpace == CUPS_CSPACE_RGB) - { - -- snprintf (szFileName, sizeof(szFileName), "/var/log/hp/tmp/hpcupsfilterc_bmp_%d_XXXXXX", current_page_number); -+ snprintf (szFileName, sizeof(szFileName), "%s/hpcupsfilterc_bmp_%d_XXXXXX", env_tmpdir, current_page_number); -+ - createTempFile(szFileName, &cfp); - if (cfp) - { -@@ -693,7 +702,7 @@ int HPCupsFilter::processRasterData(cups - if (cups_header.cupsColorSpace == CUPS_CSPACE_RGBW || - cups_header.cupsColorSpace == CUPS_CSPACE_K) - { -- snprintf (szFileName, sizeof(szFileName), "/var/log/hp/tmp/hpcupsfilterk_bmp_%d_XXXXXX", current_page_number); -+ snprintf (szFileName, sizeof(szFileName), "%s/hpcupsfilterk_bmp_%d_XXXXXX", env_tmpdir, current_page_number); - createTempFile(szFileName, &kfp); - if (kfp) - { 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,9 +42,12 @@ - #include "LJZjStream.h" +@@ -42,6 +42,7 @@ #include "Utils.h" #include "hpjbig_wrapper.h" + #include "utils.h" +#include #define ZJC_BAND_HEIGHT 100 -+extern char *env_tmpdir; -+ - LJZjStream::LJZjStream () : Encapsulator () - { - memset(&m_PM, 0, sizeof(m_PM)); -@@ -675,10 +678,10 @@ DRIVER_ERROR LJZjStream::preProcessRaste +@@ -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,}; -- snprintf(hpEvenPagesFile, sizeof(hpEvenPagesFile), "%s/hplipEvenPagesXXXXXX","/var/log/hp/tmp"); -- snprintf(hpOddPagesFile, sizeof(hpOddPagesFile), "%s/hplipOddPagesXXXXXX", "/var/log/hp/tmp"); + char hpEvenPagesFile[PATH_MAX]={0,}; + char hpOddPagesFile[PATH_MAX]={0,}; -+ snprintf(hpEvenPagesFile, sizeof(hpEvenPagesFile), "%s/hplipEvenPagesXXXXXX", env_tmpdir); -+ snprintf(hpOddPagesFile, sizeof(hpOddPagesFile), "%s/hplipOddPagesXXXXXX", env_tmpdir); + 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); - if (1 != m_pJA->pre_process_raster || !firstpage_cups_header->Duplex){ - return NO_ERROR; 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,17 @@ +@@ -31,14 +31,15 @@ #include "CommonDefinitions.h" #include "SystemServices.h" #include "utils.h" +#include -+ -+extern char *env_tmpdir; - SystemServices::SystemServices(int iLogLevel, int job_id) : m_iLogLevel(iLogLevel) + SystemServices::SystemServices(int iLogLevel, int job_id, char* user_name) : m_iLogLevel(iLogLevel) { m_fp = NULL; if (iLogLevel & SAVE_PCL_FILE) { - char fname[64]; -- sprintf(fname, "%s/hpcups_out_job%d_XXXXXX", "/var/log/hp/tmp",job_id); +- sprintf(fname, "%s/hp_%s_cups_out_job%d_XXXXXX",CUPS_TMP_DIR, user_name, job_id); + char fname[PATH_MAX]; -+ sprintf(fname, "%s/hpcups_out_job%d_XXXXXX", env_tmpdir, job_id); ++ 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) @@ -165,15 +86,7 @@ diff -up hplip-3.13.5/prnt/hpijs/hpcupsfax.cpp.logdir hplip-3.13.5/prnt/hpijs/hp #include #include #include -@@ -67,6 +68,7 @@ uint16_t (*convert_endian_s)(uint16_t); - - static int iLogLevel = 1; - char hpFileName[64] ; -+static char *env_tmpdir; - - #define TIFF_HDR_SIZE 8 - #define LITTLE_ENDIAN_MODE I -@@ -440,10 +442,10 @@ int ProcessTiffData(int fromFD, int toFD +@@ -440,7 +442,7 @@ int ProcessTiffData(int fromFD, int toFD int bytes_written = 0; int ret_status = 0; int bytes_read = 0; @@ -181,31 +94,7 @@ diff -up hplip-3.13.5/prnt/hpijs/hpcupsfax.cpp.logdir hplip-3.13.5/prnt/hpijs/hp + char hpTiffFileName[PATH_MAX]; long input_file_size = 0; FILE* pFilePtrFax; -- snprintf(hpTiffFileName,sizeof(hpTiffFileName), "%s/hpliptiffXXXXXX","/var/log/hp/tmp"); -+ snprintf(hpTiffFileName,sizeof(hpTiffFileName), "%s/hpliptiffXXXXXX",env_tmpdir); - - - // fdTiff = mkstemp (hpTiffFileName); -@@ -653,6 +655,10 @@ int main (int argc, char **argv) - - /*********** PROLOGUE ***********/ - -+ env_tmpdir = getenv ("TMPDIR"); -+ if (!env_tmpdir) -+ env_tmpdir = "/var/log/hp/tmp"; -+ - GetLogLevel(); - openlog("hpcupsfax", LOG_PID, LOG_DAEMON); - -@@ -676,7 +682,7 @@ int main (int argc, char **argv) - i++; - } - -- snprintf(hpFileName,sizeof(hpFileName),"%s/hplipfaxLog_XXXXXX","/var/log/hp/tmp"); -+ snprintf(hpFileName,sizeof(hpFileName),"%s/hplipfaxLog_XXXXXX",env_tmpdir); - - // fdFax = mkstemp (hpFileName); - fdFax = createTempFile(hpFileName, &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 @@ -217,49 +106,24 @@ diff -up hplip-3.13.5/prnt/hpijs/hpijs.cpp.logdir hplip-3.13.5/prnt/hpijs/hpijs. #include #include #include -@@ -44,6 +45,8 @@ - #include "services.h" - #include "utils.h" - -+static char *env_tmpdir; -+ - extern void SendDbusMessage (const char *dev, const char *printer, int code, - const char *username, const int jobid, const char *title); - -@@ -97,8 +100,9 @@ void setLogLevel(UXServices *pSS) +@@ -97,7 +100,7 @@ void setLogLevel(UXServices *pSS) if (pSS->m_iLogLevel & SAVE_PCL_FILE) { - char szFileName[64]; -- snprintf (szFileName,sizeof(szFileName), "/var/log/hp/tmp/hpijs_%d_XXXXXX", getpid()); + char szFileName[PATH_MAX]; -+ snprintf (szFileName,sizeof(szFileName), "%s/hpijs_%d_XXXXXX", env_tmpdir, getpid()); -+ + snprintf (szFileName,sizeof(szFileName), "%s/hp_%s_ijs_%d_XXXXXX", CUPS_TMP_DIR, user_name, getpid()); createTempFile(szFileName, &pSS->outfp); - // pSS->outfp = fopen (szFileName, "w"); -@@ -590,6 +594,10 @@ int main (int argc, char *argv[], char * - int ret, n, i, kn=0, width, k_width; - int low_marker = 0; - -+ env_tmpdir = getenv ("TMPDIR"); -+ if (!env_tmpdir) -+ env_tmpdir = "/var/log/hp/tmp"; -+ - openlog("hpijs", LOG_PID, LOG_DAEMON); - - if (argc > 1) -@@ -629,8 +637,8 @@ int main (int argc, char *argv[], char * - setLogLevel(pSS); +@@ -629,7 +637,7 @@ int main (int argc, char *argv[], char * + setLogLevel(pSS, user_name); #ifdef CAPTURE - char szCapOutFile[64]; -- snprintf(szCapOutFile, sizeof(szCapOutFile),"%s/capout_XXXXXX","/var/log/hp/tmp"); + char szCapOutFile[PATH_MAX]; -+ snprintf(szCapOutFile, sizeof(szCapOutFile),"%s/capout_XXXXXX",env_tmpdir); + 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"); - #endif 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 @@ -271,7 +135,7 @@ diff -up hplip-3.13.5/prnt/hpijs/hpijsfax.cpp.logdir hplip-3.13.5/prnt/hpijs/hpi #include #include #include -@@ -272,14 +273,15 @@ int hpijsFaxServer (int argc, char **arg +@@ -272,7 +273,7 @@ int hpijsFaxServer (int argc, char **arg IP_HANDLE hJob; FILE *pFilePtrFax; @@ -280,12 +144,3 @@ diff -up hplip-3.13.5/prnt/hpijs/hpijsfax.cpp.logdir hplip-3.13.5/prnt/hpijs/hpi int fdFax = -1; BYTE szFileHeader[68]; BYTE szPageHeader[64]; - BYTE *p; - unsigned int uiPageNum = 0; - -- snprintf(hpFileName,sizeof(hpFileName),"%s/hplipfaxXXXXXX","/var/log/hp/tmp"); -+ snprintf(hpFileName,sizeof(hpFileName),"%s/hplipfaxXXXXXX", -+ getenv ("TMPDIR") ? : "/var/log/hp/tmp"); - - - pFaxStruct = new HPIJSFax (); diff --git a/hplip-makefile-chgrp.patch b/hplip-makefile-chgrp.patch deleted file mode 100644 index 919e79f..0000000 --- a/hplip-makefile-chgrp.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff -up hplip-3.13.6/Makefile.in.chgrp hplip-3.13.6/Makefile.in ---- hplip-3.13.6/Makefile.in.chgrp 2013-06-24 10:34:05.350757765 +0200 -+++ hplip-3.13.6/Makefile.in 2013-06-24 10:36:33.104780576 +0200 -@@ -8965,18 +8965,18 @@ uninstall-am: uninstall-binPROGRAMS unin - - install-dist_hplip_LogDATA: - @FULL_BUILD_TRUE@ test -z "$(DESTDIR)$(hplip_Logdir)" || mkdir -p $(DESTDIR)$(hplip_Logdir) --@FULL_BUILD_TRUE@ chgrp "lp" -R $(DESTDIR)$(hplip_Logdir) -+#@FULL_BUILD_TRUE@ chgrp "lp" -R $(DESTDIR)$(hplip_Logdir) - @FULL_BUILD_TRUE@ chmod 775 $(DESTDIR)$(hplip_Logdir) - @HPLIP_BUILD_TRUE@ test -z "$(DESTDIR)$(hplip_Logdir)" || mkdir -p $(DESTDIR)$(hplip_Logdir) --@HPLIP_BUILD_TRUE@ chgrp "lp" -R $(DESTDIR)$(hplip_Logdir) -+#@HPLIP_BUILD_TRUE@ chgrp "lp" -R $(DESTDIR)$(hplip_Logdir) - @HPLIP_BUILD_TRUE@ chmod 775 $(DESTDIR)$(hplip_Logdir) - - install-dist_hplip_tmpDATA: - @FULL_BUILD_TRUE@ test -z "$(DESTDIR)$(hplip_tmpdir)" || mkdir -p $(DESTDIR)$(hplip_tmpdir) --@FULL_BUILD_TRUE@ chgrp "lp" -R $(DESTDIR)$(hplip_tmpdir) -+#@FULL_BUILD_TRUE@ chgrp "lp" -R $(DESTDIR)$(hplip_tmpdir) - @FULL_BUILD_TRUE@ chmod 0775 $(DESTDIR)$(hplip_tmpdir) - @HPLIP_BUILD_TRUE@ test -z "$(DESTDIR)$(hplip_tmpdir)" || mkdir -p $(DESTDIR)$(hplip_tmpdir) --@HPLIP_BUILD_TRUE@ chgrp "lp" -R $(DESTDIR)$(hplip_tmpdir) -+#@HPLIP_BUILD_TRUE@ chgrp "lp" -R $(DESTDIR)$(hplip_tmpdir) - @HPLIP_BUILD_TRUE@ chmod 0775 $(DESTDIR)$(hplip_tmpdir) - - install-data-hook: diff --git a/hplip-mkstemp.patch b/hplip-mkstemp.patch deleted file mode 100644 index f367568..0000000 --- a/hplip-mkstemp.patch +++ /dev/null @@ -1,46 +0,0 @@ -diff -up hplip-3.13.5/common/utils.c.mkstemp hplip-3.13.5/common/utils.c ---- hplip-3.13.5/common/utils.c.mkstemp 2013-05-29 15:21:17.210289396 +0100 -+++ hplip-3.13.5/common/utils.c 2013-05-29 15:24:57.214498909 +0100 -@@ -222,8 +222,6 @@ void unload_library(void *pLibHandler) - int createTempFile(char* szFileName, FILE** pFilePtr) - { - char* pFilePos = NULL; -- char szFolderName[64]={0,}; -- struct stat st; - int iFD; - - if (szFileName == NULL || szFileName[0] == '\0' || pFilePtr == NULL) -@@ -235,28 +233,11 @@ int createTempFile(char* szFileName, FIL - if (strstr(szFileName,"XXXXXX") == NULL) - strcat(szFileName,"_XXXXXX"); - -- pFilePos = strrchr(szFileName, '/'); -- if (pFilePos) -- { -- strncpy(szFolderName, szFileName, (pFilePos - szFileName)); -- if(stat(szFolderName,&st) == 0) -- { -- if(st.st_mode & S_IFDIR != 0) -- { -- iFD = mkstemp(szFileName); -- *pFilePtr = fdopen(iFD,"w+"); -- } -- else -- BUG("Insufficient directory [%s] permissions\n",szFolderName); -- } -- else -- BUG("Failed to check directory [%s] errno[%d]\n",szFolderName, errno); -- } -+ iFD = mkstemp(szFileName); -+ if (iFD == -1) -+ BUG("Failed to create tmpfile [%s]: %s\n", szFileName, strerror (errno)); - else -- { -- iFD = mkstemp(szFileName); - *pFilePtr = fdopen(iFD,"w+"); -- } - - return iFD; --} -\ No newline at end of file -+} diff --git a/hplip-mucks-with-spooldir.patch b/hplip-mucks-with-spooldir.patch deleted file mode 100644 index 6738b8c..0000000 --- a/hplip-mucks-with-spooldir.patch +++ /dev/null @@ -1,30 +0,0 @@ -diff -up hplip-3.12.6/prnt/hpcups/HPCupsFilter.cpp.mucks-with-spooldir hplip-3.12.6/prnt/hpcups/HPCupsFilter.cpp ---- hplip-3.12.6/prnt/hpcups/HPCupsFilter.cpp.mucks-with-spooldir 2012-06-18 12:40:17.000000000 +0200 -+++ hplip-3.12.6/prnt/hpcups/HPCupsFilter.cpp 2012-06-19 10:55:05.325913806 +0200 -@@ -474,26 +474,6 @@ int HPCupsFilter::StartPrintJob(int arg - - getLogLevel(); - m_JA.job_id = atoi(argv[1]); -- FILE *fp; -- char dFileName[32]; -- memset(dFileName, 0, sizeof(dFileName)); -- m_JA.job_id = atoi(argv[1]); -- snprintf (dFileName, sizeof(dFileName), "/var/spool/cups/d%05d-001", m_JA.job_id); -- if ((fp = fopen (dFileName, "r"))) -- { -- char line[258]; -- for (int i = 0; i < 10; i++) -- { -- fgets (line, 256, fp); -- if (!strncmp (line, "%%Pages:", 8)) -- { -- sscanf (line+9, "%d", &m_JA.total_pages); -- break; -- } -- } -- fclose (fp); -- } -- - m_ppd = ppdOpenFile(getenv("PPD")); - if (m_ppd == NULL) { - dbglog("DEBUG: ppdOpenFile failed for %s\n", getenv("PPD")); diff --git a/hplip-udev-rules.patch b/hplip-udev-rules.patch index ee415b2..9c047f6 100644 --- a/hplip-udev-rules.patch +++ b/hplip-udev-rules.patch @@ -2,7 +2,7 @@ diff -up hplip-3.13.6/data/rules/56-hpmud.rules.udev-rules hplip-3.13.6/data/rul --- hplip-3.13.6/data/rules/56-hpmud.rules.udev-rules 2013-06-24 10:28:19.865301396 +0200 +++ hplip-3.13.6/data/rules/56-hpmud.rules 2013-06-24 10:31:21.283926852 +0200 @@ -11,8 +11,6 @@ LABEL="hpmud_usb_rules" - ATTR{idVendor}=="03f0", ATTR{idProduct}=="????", OWNER="root", GROUP="lp", MODE="0660", ENV{sane_hpaio}="yes", ENV{libsane_matched}="yes", ENV{hp_test}="yes", ENV{ID_HPLIP}="1" + 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 diff --git a/hplip-ui-optional.patch b/hplip-ui-optional.patch index 03c5794..d389d6e 100644 --- a/hplip-ui-optional.patch +++ b/hplip-ui-optional.patch @@ -15,12 +15,11 @@ diff -up hplip-3.12.11/base/utils.py.ui-optional hplip-3.12.11/base/utils.py log.error("PyQt not installed. GUI not available. Exiting.") return False -@@ -712,7 +719,10 @@ def checkPyQtImport(): # qt3 - def checkPyQtImport4(): - try: +@@ -712,7 +719,8 @@ def checkPyQtImport4(): import PyQt4 -+ import ui4 + import ui4 except ImportError: +- log.error("HPLIP is not installed properly or is installed without graphical support. Please reinstall HPLIP") + # hplip-gui sub-package (Fedora) requires PyQt4 + log.error("Install the hplip-gui package for graphical support.") return False diff --git a/hplip.spec b/hplip.spec index 376e762..cee5301 100644 --- a/hplip.spec +++ b/hplip.spec @@ -6,8 +6,8 @@ Summary: HP Linux Imaging and Printing Project Name: hplip -Version: 3.13.9 -Release: 2%{?dist} +Version: 3.13.10 +Release: 1%{?dist} License: GPLv2+ and MIT Group: System Environment/Daemons @@ -20,24 +20,16 @@ Patch2: hplip-strstr-const.patch Patch3: hplip-ui-optional.patch Patch4: hplip-no-asm.patch Patch5: hplip-deviceIDs-drv.patch -Patch6: hplip-mucks-with-spooldir.patch -Patch7: hplip-udev-rules.patch -Patch8: hplip-retry-open.patch -Patch9: hplip-snmp-quirks.patch -Patch10: hplip-discovery-method.patch -Patch11: hplip-hpijs-marker-supply.patch -Patch12: hplip-clear-old-state-reasons.patch -Patch13: hplip-hpcups-sigpipe.patch -Patch14: hplip-logdir.patch -Patch15: hplip-bad-low-ink-warning.patch -Patch16: hplip-deviceIDs-ppd.patch -Patch17: hplip-ppd-ImageableArea.patch -Patch18: hplip-addprinter.patch -Patch19: hplip-makefile-chgrp.patch -Patch20: hplip-hpaio-localonly.patch -Patch21: hplip-check.patch -Patch22: hplip-mkstemp.patch -Patch23: hplip-CVE-2013-4325.patch +Patch6: hplip-udev-rules.patch +Patch7: hplip-retry-open.patch +Patch8: hplip-snmp-quirks.patch +Patch9: hplip-hpijs-marker-supply.patch +Patch10: hplip-clear-old-state-reasons.patch +Patch11: hplip-hpcups-sigpipe.patch +Patch12: hplip-logdir.patch +Patch13: hplip-bad-low-ink-warning.patch +Patch14: hplip-deviceIDs-ppd.patch +Patch15: hplip-ppd-ImageableArea.patch %global hpijs_epoch 1 Requires: hpijs%{?_isa} = %{hpijs_epoch}:%{version}-%{release} @@ -172,37 +164,30 @@ mv prnt/drv/hpijs.drv.in{,.deviceIDs-drv-hpijs} prnt/drv/hpijs.drv.in.deviceIDs-drv-hpijs \ > prnt/drv/hpijs.drv.in -# Stopped hpcups pointlessly trying to read spool files -# directly (bug #552572). -%patch6 -p1 -b .mucks-with-spooldir - # Don't add printer queue, just check plugin. # Move udev rules from /etc/ to /usr/lib/ (bug #748208). -%patch7 -p1 -b .udev-rules +%patch6 -p1 -b .udev-rules # Retry when connecting to device fails (bug #532112). -%patch8 -p1 -b .retry-open +%patch7 -p1 -b .retry-open # Mark SNMP quirks in PPD for HP OfficeJet Pro 8500 (bug #581825). -%patch9 -p1 -b .snmp-quirks - -# Fixed hp-setup traceback when discovery page is skipped (bug #523685). -%patch10 -p1 -b .discovery-method +%patch8 -p1 -b .snmp-quirks # Fixed bogus low ink warnings from hpijs driver (bug #643643). -%patch11 -p1 -b .hpijs-marker-supply +%patch9 -p1 -b .hpijs-marker-supply # Clear old printer-state-reasons we used to manage (bug #510926). -%patch12 -p1 -b .clear-old-state-reasons +%patch10 -p1 -b .clear-old-state-reasons # Avoid busy loop in hpcups when backend has exited (bug #525944). -%patch13 -p1 -b .hpcups-sigpipe +%patch11 -p1 -b .hpcups-sigpipe # CUPS filters should use TMPDIR when available (bug #865603). -%patch14 -p1 -b .logdir +%patch12 -p1 -b .logdir # Fixed Device ID parsing code in hpijs's dj9xxvip.c (bug #510926). -%patch15 -p1 -b .bad-low-ink-warning +%patch13 -p1 -b .bad-low-ink-warning # Add Device ID for # LaserJet 1200 (bug #577308) @@ -222,47 +207,27 @@ mv prnt/drv/hpijs.drv.in{,.deviceIDs-drv-hpijs} # Designjet T770 (bug #747957) # Color LaserJet CM4540 MFP (bug #968177) # Color LaserJet cp4005 (bug #980976) -for ppd_file in $(grep '^diff' %{PATCH16} | cut -d " " -f 4); +for ppd_file in $(grep '^diff' %{PATCH14} | cut -d " " -f 4); do gunzip ${ppd_file#*/}.gz done -%patch16 -p1 -b .deviceIDs-ppd -for ppd_file in $(grep '^diff' %{PATCH16} | cut -d " " -f 4); +%patch14 -p1 -b .deviceIDs-ppd +for ppd_file in $(grep '^diff' %{PATCH14} | cut -d " " -f 4); do gzip -n ${ppd_file#*/} done # Fix ImageableArea for Laserjet 8150/9000 (bug #596298). -for ppd_file in $(grep '^diff' %{PATCH17} | cut -d " " -f 4); +for ppd_file in $(grep '^diff' %{PATCH15} | cut -d " " -f 4); do gunzip ${ppd_file#*/}.gz done -%patch17 -p1 -b .ImageableArea -for ppd_file in $(grep '^diff' %{PATCH17} | cut -d " " -f 4); +%patch15 -p1 -b .ImageableArea +for ppd_file in $(grep '^diff' %{PATCH15} | cut -d " " -f 4); do gzip -n ${ppd_file#*/} done -# Call cupsSetUser in cupsext's addPrinter method before connecting so -# that we can get an authentication callback (bug #538352). -%patch18 -p1 -b .addprinter - -# Don't run 'chgrp lp /var/log/hp' and 'chgrp lp /var/log/hp/tmp' in makefile -%patch19 -p1 -b .chgrp - -# Pay attention to the SANE localOnly flag in hpaio (bug #743593). -%patch20 -p1 -b .hpaio-localonly - -# Various adjustments to make 'hp-check' run more smoothly (bug #683007). -%patch21 -p1 -b .check - -# Avoid several bugs in createTempFile (bug #925032). -%patch22 -p1 -b .mkstemp - -# Applied patch to avoid unix-process authorization subject when using -# polkit as it is racy (CVE-2013-4325). -%patch23 -p1 -b .CVE-2013-4325 - sed -i.duplex-constraints \ -e 's,\(UIConstraints.* \*Duplex\),//\1,' \ prnt/drv/hpcups.drv.in @@ -371,7 +336,6 @@ rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/hplip-systray.desktop %{_bindir}/hp-logcapture %{_bindir}/hp-makecopies %{_bindir}/hp-makeuri -%{_bindir}/hp-mkuri %{_bindir}/hp-plugin %{_bindir}/hp-pqdiag %{_bindir}/hp-printsettings @@ -435,8 +399,6 @@ rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/hplip-systray.desktop %{_datadir}/hplip/prnt %{_datadir}/hplip/scan %{_localstatedir}/lib/hp -%dir %attr(0774,root,lp) %{_localstatedir}/log/hp -%dir %attr(1774,root,lp) %{_localstatedir}/log/hp/tmp %dir %attr(0775,root,lp) %{_localstatedir}/run/hplip %files common @@ -492,6 +454,10 @@ rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/hplip-systray.desktop %postun libs -p /sbin/ldconfig %changelog +* Tue Oct 15 2013 Jaromír Končický - 3.13.10-1 +- 3.13.10: 8 patches applied upstream, big changes in tmp and log dirs, removed hp-mkuri +- Fixed Incorrect IEEE 1284 MFG value for LaserJet Professional P1102 (bug #1018826). + * Wed Sep 18 2013 Tim Waugh - 3.13.9-2 - Applied patch to avoid unix-process authorization subject when using polkit as it is racy (bug #1009541, CVE-2013-4325). diff --git a/sources b/sources index ca52e0d..d025d02 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -8fcbbd0d3a0b76550f325bd6cf46d9d9 hplip-3.13.9.tar.gz +ba729c514a2dc95390b99e9a9d452999 hplip-3.13.10.tar.gz