hplip: upgrade 3.22.10 -> 3.25.8

Contains fix for CVE-2025-43023, and support for many new printers.

Drop patches that are included in this release (or the underlying problem
was solved on another way)

Changelog: https://developers.hp.com/hp-linux-imaging-and-printing/release_notes

Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Gyorgy Sarvari 2026-03-03 19:03:26 +01:00 committed by Khem Raj
parent 7125b918bd
commit 13b791e31d
No known key found for this signature in database
GPG Key ID: BB053355919D3314
6 changed files with 35 additions and 124 deletions

View File

@ -7,38 +7,29 @@ Also define _GNU_SOURCE for the same
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Rebased for latest version. string.h is included already, left
only the _GNU_SOURCE definition.
Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
---
common/utils.c | 2 ++
1 file changed, 2 insertions(+)
--- a/common/utils.c
+++ b/common/utils.c
@@ -1,9 +1,11 @@
@@ -1,3 +1,4 @@
+#define _GNU_SOURCE
#include "utils.h"
#include "string.h"
#include <dlfcn.h>
#include <sys/stat.h>
#include <errno.h>
#include <stdlib.h>
+#include <string.h> /* strcasestr */
extern int errno;
--- a/protocol/hp_ipp.c
+++ b/protocol/hp_ipp.c
@@ -18,12 +18,13 @@ Boston, MA 02110-1301, USA.
@@ -18,6 +18,7 @@ Boston, MA 02110-1301, USA.
\******************************************************************************/
-
+#define _GNU_SOURCE
#include <cups/cups.h>
#include <cups/language.h>
#include <cups/ppd.h>
#include <syslog.h>
#include <stdarg.h>
+#include <string.h> /* strcasecmp */
#include <sys/types.h>
#include <pwd.h>
#include <sys/stat.h>

View File

@ -13,18 +13,19 @@ Upstream-Status: Pending
--- a/prnt/cupsext/cupsext.c
+++ b/prnt/cupsext/cupsext.c
@@ -101,6 +101,11 @@ typedef int Py_ssize_t;
@@ -99,6 +99,12 @@ typedef int Py_ssize_t;
#define _STRINGIZE(x) #x
#define STRINGIZE(x) _STRINGIZE(x)
+void _releaseCupsInstance(void);
+int addCupsPrinter(char *name, char *device_uri, char *location, char *ppd_file, char *model, char *info);
+int setDefaultCupsPrinter(char *pr_name);
+int delCupsPrinter(char *pr_name);
+int controlCupsPrinter(char *pr_name, int op);
//static http_t * http = NULL; /* HTTP object */
+
// static http_t * http = NULL; /* HTTP object */
PyObject *releaseCupsInstance(PyObject *self, PyObject *args)
--- a/protocol/hp_ipp.c
+++ b/protocol/hp_ipp.c
@@ -22,6 +22,7 @@ Boston, MA 02110-1301, USA.
@ -34,20 +35,20 @@ Upstream-Status: Pending
+#include <stdio.h>
#include <syslog.h>
#include <stdarg.h>
#include <string.h> /* strcasecmp */
@@ -42,7 +43,7 @@ Boston, MA 02110-1301, USA.
#define STRINGIZE(x) _STRINGIZE(x)
-http_t* acquireCupsInstance()
+http_t* acquireCupsInstance(void)
#include <sys/types.h>
@@ -45,7 +46,7 @@ Boston, MA 02110-1301, USA.
dst[size - 1] = '\0'; \
} while (0)
-http_t *acquireCupsInstance()
+http_t *acquireCupsInstance(void)
{
if ( http == NULL)
if (http == NULL)
{
@@ -53,7 +54,7 @@ http_t* acquireCupsInstance()
@@ -55,7 +56,7 @@ http_t* acquireCupsInstance()
return http;
}
-void _releaseCupsInstance()
+void _releaseCupsInstance(void)
{

View File

@ -1,64 +0,0 @@
From 4b3014df3990d90d6929510f2bde073171503329 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 2 Sep 2022 18:18:44 -0700
Subject: [PATCH] hp_ipp.c: Add printf format to snprintf calls
Avoid -Wformat warnings
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
Upstream-Status: Pending
protocol/hp_ipp.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/protocol/hp_ipp.c b/protocol/hp_ipp.c
index 597d9b9..a027baf 100644
--- a/protocol/hp_ipp.c
+++ b/protocol/hp_ipp.c
@@ -112,7 +112,7 @@ int addCupsPrinter(char *name, char *device_uri, char *location, char *ppd_file,
}
if ( info == NULL )
- snprintf( info,sizeof(info), name );
+ snprintf( info,sizeof(info), "%s", name );
sprintf( printer_uri, "ipp://localhost/printers/%s", name );
@@ -513,27 +513,27 @@ int __parsePrinterAttributes(ipp_t *response, printer_t **printer_list)
if ( strcmp(attr_name, "printer-name") == 0 &&
val_tag == IPP_TAG_NAME ) {
- snprintf(t_printer->name, sizeof(t_printer->name),ippGetString(attr, 0, NULL) );
+ snprintf(t_printer->name, sizeof(t_printer->name), "%s", ippGetString(attr, 0, NULL) );
}
else if ( strcmp(attr_name, "device-uri") == 0 &&
val_tag == IPP_TAG_URI ) {
- snprintf(t_printer->device_uri,sizeof(t_printer->device_uri), ippGetString(attr, 0, NULL) );
+ snprintf(t_printer->device_uri,sizeof(t_printer->device_uri), "%s", ippGetString(attr, 0, NULL) );
}
else if ( strcmp(attr_name, "printer-uri-supported") == 0 &&
val_tag == IPP_TAG_URI ) {
- snprintf(t_printer->printer_uri,sizeof(t_printer->printer_uri), ippGetString(attr, 0, NULL) );
+ snprintf(t_printer->printer_uri,sizeof(t_printer->printer_uri), "%s", ippGetString(attr, 0, NULL) );
}
else if ( strcmp(attr_name, "printer-info") == 0 &&
val_tag == IPP_TAG_TEXT ) {
- snprintf(t_printer->info,sizeof(t_printer->info), ippGetString(attr, 0, NULL) );
+ snprintf(t_printer->info,sizeof(t_printer->info), "%s", ippGetString(attr, 0, NULL) );
}
else if ( strcmp(attr_name, "printer-location") == 0 &&
val_tag == IPP_TAG_TEXT ) {
- snprintf(t_printer->location,sizeof(t_printer->location),ippGetString(attr, 0, NULL) );
+ snprintf(t_printer->location,sizeof(t_printer->location), "%s", ippGetString(attr, 0, NULL) );
}
else if ( strcmp(attr_name, "printer-make-and-model") == 0 &&
val_tag == IPP_TAG_TEXT ) {
- snprintf(t_printer->make_model,sizeof(t_printer->make_model),ippGetString(attr, 0, NULL) );
+ snprintf(t_printer->make_model,sizeof(t_printer->make_model), "%s", ippGetString(attr, 0, NULL) );
}
else if ( strcmp(attr_name, "printer-state") == 0 &&
val_tag == IPP_TAG_ENUM ) {
--
2.37.3

View File

@ -3,7 +3,7 @@ Upstream-Status: Pending
--- a/configure.in
+++ b/configure.in
@@ -30,7 +30,7 @@
AC_INIT([HP Linux Imaging and Printing], [3.22.10], [3.22.10], [hplip])
AC_INIT([HP Linux Imaging and Printing], [3.25.8], [3.25.8], [hplip])
#AM_INIT_AUTOMAKE([1.9 foreign])
-AM_INIT_AUTOMAKE

View File

@ -1,22 +0,0 @@
From 2fcd0e79b21ec6dbf975ad7d1b5697a78993e2f1 Mon Sep 17 00:00:00 2001
From: David Valleau <valleau@chromium.org>
Date: Wed, 14 Aug 2019 15:47:38 -0700
Subject: [PATCH] Fixing invalid return in void function
---
Upstream-Status: Pending
prnt/hpps/hppsfilter.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/prnt/hpps/hppsfilter.c
+++ b/prnt/hpps/hppsfilter.c
@@ -104,7 +104,7 @@ static void open_tempbookletfile(char *m
if(ptempbooklet_file == NULL)
{
fprintf(stderr, "ERROR: Unable to open temp file %s\n", temp_filename);
- return 1;
+ return;
}
chmod(temp_filename, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);

View File

@ -8,17 +8,15 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BP}.tar.gz \
file://600-fix.patch \
file://030-replace_unsafe_memcpy_with_memmove.patch \
file://050-fix-glibcisms.patch \
file://hplip-3.19.6-fix-return.patch \
file://0001-common-utils-Include-string.h-for-strcasestr.patch \
file://0002-Add-ImageProcessor-only-when-DISBALE_IMAGEPROCESSOR_.patch \
file://0003-pserror.c-Define-column-to-be-int-explcitly.patch \
file://0004-Define-missing-prototype-for-functions.patch \
file://0005-hp_ipp.c-Add-printf-format-to-snprintf-calls.patch \
file://0006-Workaround-patch-for-missing-Python3-transition-of-t.patch \
file://0001-Fix-installing-ipp-usb-quirk.patch \
file://0001-Drop-using-register-storage-classifier.patch \
file://0001-Fix-upstream-CFLAGS-override.patch"
SRC_URI[sha256sum] = "533c3f2f6b53e4163ded4fd81d1f11ae6162a0f6451bd5e62a8382d0c1366624"
SRC_URI[sha256sum] = "1cf6d6c28735435c8eb6646e83bcfb721e51c4b1f0e8cf9105a6faf96dc9ad25"
CVE_PRODUCT = "hplip linux_imaging_and_printing"
@ -51,6 +49,13 @@ EXTRA_OECONF += "\
EXTRA_OEMAKE = "rulessystemdir=${systemd_unitdir}/system/"
do_configure:prepend() {
# If not set directly, it determines the absolute path of site-packages dir in recipe-sysroot,
# and then it installs the python libraries into a folder in ${D} that was constructed from
# that path, instead of using the correct ${PYTHON_SITEPACKAGES_DIR}.
sed -i 's,^\( PYTHONEXECDIR=\).*,\1"${PYTHON_SITEPACKAGES_DIR}",' configure.in
}
do_install:append() {
rm -rf ${D}${datadir}/hplip/upgrade.py
rm -rf ${D}${datadir}/hplip/uninstall.py