hplip/hplip-logdir.patch
2013-11-13 16:39:35 +04:00

146 lines
5.9 KiB
Diff

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 <limits.h>
#include <signal.h>
#include <sys/wait.h>
#include <sys/utsname.h>
@@ -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.
- 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);
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 <limits.h>
#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 <limits.h>
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/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 <limits.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
@@ -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 <limits.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
@@ -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 <limits.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
@@ -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];