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 <[email protected]> --- ...tils-Include-string.h-for-strcasestr.patch | 27 +++----- ...fine-missing-prototype-for-functions.patch | 33 +++++----- ...-Add-printf-format-to-snprintf-calls.patch | 64 ------------------- .../hplip/hplip/configure.patch | 2 +- .../hplip/hplip/hplip-3.19.6-fix-return.patch | 22 ------- .../{hplip_3.22.10.bb => hplip_3.25.8.bb} | 11 +++- 6 files changed, 35 insertions(+), 124 deletions(-) delete mode 100644 meta-oe/recipes-extended/hplip/hplip/0005-hp_ipp.c-Add-printf-format-to-snprintf-calls.patch delete mode 100644 meta-oe/recipes-extended/hplip/hplip/hplip-3.19.6-fix-return.patch rename meta-oe/recipes-extended/hplip/{hplip_3.22.10.bb => hplip_3.25.8.bb} (86%) diff --git a/meta-oe/recipes-extended/hplip/hplip/0001-common-utils-Include-string.h-for-strcasestr.patch b/meta-oe/recipes-extended/hplip/hplip/0001-common-utils-Include-string.h-for-strcasestr.patch index 659eca41c9..1457fc62c8 100644 --- a/meta-oe/recipes-extended/hplip/hplip/0001-common-utils-Include-string.h-for-strcasestr.patch +++ b/meta-oe/recipes-extended/hplip/hplip/0001-common-utils-Include-string.h-for-strcasestr.patch @@ -7,38 +7,29 @@ Also define _GNU_SOURCE for the same Upstream-Status: Pending Signed-off-by: Khem Raj <[email protected]> + +Rebased for latest version. string.h is included already, left +only the _GNU_SOURCE definition. + +Signed-off-by: Gyorgy Sarvari <[email protected]> --- 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> diff --git a/meta-oe/recipes-extended/hplip/hplip/0004-Define-missing-prototype-for-functions.patch b/meta-oe/recipes-extended/hplip/hplip/0004-Define-missing-prototype-for-functions.patch index 7223bf939e..b17d8ec8fd 100644 --- a/meta-oe/recipes-extended/hplip/hplip/0004-Define-missing-prototype-for-functions.patch +++ b/meta-oe/recipes-extended/hplip/hplip/0004-Define-missing-prototype-for-functions.patch @@ -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) { diff --git a/meta-oe/recipes-extended/hplip/hplip/0005-hp_ipp.c-Add-printf-format-to-snprintf-calls.patch b/meta-oe/recipes-extended/hplip/hplip/0005-hp_ipp.c-Add-printf-format-to-snprintf-calls.patch deleted file mode 100644 index ac0ff81e6f..0000000000 --- a/meta-oe/recipes-extended/hplip/hplip/0005-hp_ipp.c-Add-printf-format-to-snprintf-calls.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 4b3014df3990d90d6929510f2bde073171503329 Mon Sep 17 00:00:00 2001 -From: Khem Raj <[email protected]> -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 <[email protected]> ---- -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 - diff --git a/meta-oe/recipes-extended/hplip/hplip/configure.patch b/meta-oe/recipes-extended/hplip/hplip/configure.patch index 0e0fd47fa1..9dad089ff1 100644 --- a/meta-oe/recipes-extended/hplip/hplip/configure.patch +++ b/meta-oe/recipes-extended/hplip/hplip/configure.patch @@ -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 diff --git a/meta-oe/recipes-extended/hplip/hplip/hplip-3.19.6-fix-return.patch b/meta-oe/recipes-extended/hplip/hplip/hplip-3.19.6-fix-return.patch deleted file mode 100644 index 45b25c5e76..0000000000 --- a/meta-oe/recipes-extended/hplip/hplip/hplip-3.19.6-fix-return.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 2fcd0e79b21ec6dbf975ad7d1b5697a78993e2f1 Mon Sep 17 00:00:00 2001 -From: David Valleau <[email protected]> -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); - diff --git a/meta-oe/recipes-extended/hplip/hplip_3.22.10.bb b/meta-oe/recipes-extended/hplip/hplip_3.25.8.bb similarity index 86% rename from meta-oe/recipes-extended/hplip/hplip_3.22.10.bb rename to meta-oe/recipes-extended/hplip/hplip_3.25.8.bb index 2b53d19f9f..3b5f58f320 100644 --- a/meta-oe/recipes-extended/hplip/hplip_3.22.10.bb +++ b/meta-oe/recipes-extended/hplip/hplip_3.25.8.bb @@ -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
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#124834): https://lists.openembedded.org/g/openembedded-devel/message/124834 Mute This Topic: https://lists.openembedded.org/mt/118118185/21656 Group Owner: [email protected] Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
