mirror of
https://abf.rosa.ru/djam/hplip.git
synced 2025-02-23 16:32:58 +00:00
add patch source
This commit is contained in:
parent
2e21697a71
commit
24eb4a9567
4 changed files with 134 additions and 0 deletions
11
fix-uninitialized-variables.patch
Normal file
11
fix-uninitialized-variables.patch
Normal file
|
@ -0,0 +1,11 @@
|
|||
--- ip/xmatrix.c.orig 2004-02-18 23:43:44.000000000 +0100
|
||||
+++ ip/xmatrix.c 2005-05-17 13:48:17.000000000 +0200
|
||||
@@ -380,7 +380,7 @@
|
||||
|
||||
while (pwOut < (WORD*)pOutAfter)
|
||||
{
|
||||
- int prod0, prod1, prod2;
|
||||
+ int prod0 = 0, prod1 = 0, prod2 = 0;
|
||||
|
||||
/* The fixed-point calculations below are as follows:
|
||||
* 17.15 = input pixel
|
32
hpaio-option-duplex.diff
Normal file
32
hpaio-option-duplex.diff
Normal file
|
@ -0,0 +1,32 @@
|
|||
--- a/scan/sane/sclpml.c
|
||||
+++ b/scan/sane/sclpml.c
|
||||
@@ -1063,20 +1063,17 @@
|
||||
hpaio->option[OPTION_ADF_MODE].constraint_type = SANE_CONSTRAINT_STRING_LIST;
|
||||
hpaio->option[OPTION_ADF_MODE].constraint.string_list = hpaio->adfModeList;
|
||||
|
||||
- // Duplex scanning is supported
|
||||
- if (hpaio->supportsDuplex == 1)
|
||||
- {
|
||||
- hpaio->option[OPTION_DUPLEX].name = STR_NAME_DUPLEX;
|
||||
- hpaio->option[OPTION_DUPLEX].title = STR_TITLE_DUPLEX;
|
||||
- hpaio->option[OPTION_DUPLEX].desc = STR_DESC_DUPLEX;
|
||||
- hpaio->option[OPTION_DUPLEX].type = SANE_TYPE_BOOL;
|
||||
- hpaio->option[OPTION_DUPLEX].unit = SANE_UNIT_NONE;
|
||||
- hpaio->option[OPTION_DUPLEX].size = sizeof( SANE_Bool );
|
||||
- hpaio->option[OPTION_DUPLEX].cap = SANE_CAP_SOFT_SELECT |
|
||||
+ hpaio->option[OPTION_DUPLEX].name = STR_NAME_DUPLEX;
|
||||
+ hpaio->option[OPTION_DUPLEX].title = STR_TITLE_DUPLEX;
|
||||
+ hpaio->option[OPTION_DUPLEX].desc = STR_DESC_DUPLEX;
|
||||
+ hpaio->option[OPTION_DUPLEX].type = SANE_TYPE_BOOL;
|
||||
+ hpaio->option[OPTION_DUPLEX].unit = SANE_UNIT_NONE;
|
||||
+ hpaio->option[OPTION_DUPLEX].size = sizeof( SANE_Bool );
|
||||
+ hpaio->option[OPTION_DUPLEX].cap = SANE_CAP_SOFT_SELECT |
|
||||
SANE_CAP_SOFT_DETECT |
|
||||
SANE_CAP_ADVANCED;
|
||||
- hpaio->option[OPTION_DUPLEX].constraint_type = SANE_CONSTRAINT_NONE;
|
||||
- }
|
||||
+ hpaio->option[OPTION_DUPLEX].constraint_type = SANE_CONSTRAINT_NONE;
|
||||
+
|
||||
hpaio->option[GROUP_GEOMETRY].title = STR_TITLE_GEOMETRY;
|
||||
hpaio->option[GROUP_GEOMETRY].type = SANE_TYPE_GROUP;
|
||||
hpaio->option[GROUP_GEOMETRY].cap = SANE_CAP_ADVANCED;
|
90
hplip-3.12.9-CVE-2013-0200.patch
Normal file
90
hplip-3.12.9-CVE-2013-0200.patch
Normal file
|
@ -0,0 +1,90 @@
|
|||
--- hplip-3.12.9/prnt/hpcups/HPCupsFilter.cpp~ 2013-02-21 17:11:06.356373425 -0500
|
||||
+++ hplip-3.12.9/prnt/hpcups/HPCupsFilter.cpp 2013-02-21 17:17:44.826579491 -0500
|
||||
@@ -649,20 +649,23 @@ int HPCupsFilter::processRasterData(cups
|
||||
{
|
||||
char szFileName[64];
|
||||
memset(szFileName, 0, sizeof(szFileName));
|
||||
- snprintf (szFileName, sizeof(szFileName), "/var/log/hp/tmp/hpcupsfilterc_%d.bmp", current_page_number);
|
||||
+ snprintf (szFileName, sizeof(szFileName), "/var/log/hp/tmp/hpcupsfilterc_%d.bmp.XXXXXX", current_page_number);
|
||||
|
||||
if (cups_header.cupsColorSpace == CUPS_CSPACE_RGBW ||
|
||||
cups_header.cupsColorSpace == CUPS_CSPACE_RGB)
|
||||
{
|
||||
- cfp = fopen (szFileName, "w");
|
||||
- chmod (szFileName, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
|
||||
+ int fd = mkstemp (szFileName);
|
||||
+ if (fd != -1)
|
||||
+ cfp = fdopen(fd, "w");
|
||||
}
|
||||
if (cups_header.cupsColorSpace == CUPS_CSPACE_RGBW ||
|
||||
cups_header.cupsColorSpace == CUPS_CSPACE_K)
|
||||
{
|
||||
- szFileName[17] = 'k';
|
||||
- kfp = fopen (szFileName, "w");
|
||||
- chmod (szFileName, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
|
||||
+ int fd;
|
||||
+ snprintf (szFileName, sizeof(szFileName), "/tmp/hpcupsfilterk_%d.bmp.XXXXXX", current_page_number);
|
||||
+ fd = mkstemp (szFileName);
|
||||
+ if (fd != -1)
|
||||
+ kfp = fdopen(fd, "w");
|
||||
}
|
||||
|
||||
WriteBMPHeader (cfp, cups_header.cupsWidth, cups_header.cupsHeight, COLOR_RASTER);
|
||||
--- hplip-3.12.9/prnt/hpcups/SystemServices.cpp~ 2012-09-04 08:31:10.000000000 -0400
|
||||
+++ hplip-3.12.9/prnt/hpcups/SystemServices.cpp 2013-02-21 17:20:58.096677737 -0500
|
||||
@@ -36,10 +36,12 @@ SystemServices::SystemServices(int iLogL
|
||||
m_fp = NULL;
|
||||
if (iLogLevel & SAVE_PCL_FILE)
|
||||
{
|
||||
+ int fd;
|
||||
char fname[64];
|
||||
- sprintf(fname, "%s/hpcups_job%d.out", "/var/log/hp/tmp",job_id);
|
||||
- m_fp = fopen(fname, "w");
|
||||
- chmod(fname, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
|
||||
+ sprintf(fname, "%s/hpcups_job%d.out.XXXXXX", "/var/log/hp/tmp",job_id);
|
||||
+ fd = mkstemp (fname);
|
||||
+ if (fd != -1)
|
||||
+ m_fp = fdopen(fd, "w");
|
||||
}
|
||||
}
|
||||
|
||||
--- hplip-3.12.9/prnt/hpijs/hpijs.cpp~ 2013-02-21 17:11:06.356373425 -0500
|
||||
+++ hplip-3.12.9/prnt/hpijs/hpijs.cpp 2013-02-21 17:23:08.696743534 -0500
|
||||
@@ -96,14 +96,12 @@ void setLogLevel(UXServices *pSS)
|
||||
|
||||
if (pSS->m_iLogLevel & SAVE_PCL_FILE)
|
||||
{
|
||||
+ int fd;
|
||||
char szFileName[64];
|
||||
- snprintf (szFileName,sizeof(szFileName), "/var/log/hp/tmp/hpijs_%d.out", getpid());
|
||||
-
|
||||
- pSS->outfp = fopen (szFileName, "w");
|
||||
- if (pSS->outfp)
|
||||
- {
|
||||
- chmod (szFileName, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
|
||||
- }
|
||||
+ snprintf (szFileName,sizeof(szFileName), "/var/log/hp/tmp/hpijs_%d.out.XXXXXX", getpid());
|
||||
+ fd = mkstemp (szFileName);
|
||||
+ if (fd != -1)
|
||||
+ pSS->outfp = fdopen (fd, "w");
|
||||
}
|
||||
}
|
||||
|
||||
--- hplip-3.12.9/prnt/hpps/hppsfilter.c~ 2012-09-04 08:31:10.000000000 -0400
|
||||
+++ hplip-3.12.9/prnt/hpps/hppsfilter.c 2013-02-21 17:25:50.566824441 -0500
|
||||
@@ -93,10 +93,12 @@ void open_dbg_outfile(char* szjob_id)
|
||||
g_fp_outdbgps = NULL;
|
||||
if (g_savepsfile & SAVE_PS_FILE)
|
||||
{
|
||||
+ int fd;
|
||||
char sfile_name[FILE_NAME_SIZE] = {0};
|
||||
- sprintf(sfile_name, "%s/%s_%d.out",DBG_TMP_FOLDER,DBG_PSFILE, szjob_id);
|
||||
- g_fp_outdbgps= fopen(sfile_name, "w");
|
||||
- chmod(sfile_name, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
|
||||
+ sprintf(sfile_name, "%s/%s_%d.out.XXXXXX",DBG_TMP_FOLDER,DBG_PSFILE, szjob_id);
|
||||
+ fd = mkstemp (sfile_name);
|
||||
+ if (fd != -1)
|
||||
+ g_fp_outdbgps= fdopen(fd, "w");
|
||||
}
|
||||
}
|
||||
|
1
hplip-tmpfiles.conf
Normal file
1
hplip-tmpfiles.conf
Normal file
|
@ -0,0 +1 @@
|
|||
d /run/hplip 0755 root root -
|
Loading…
Add table
Reference in a new issue