public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
To: git-commits@fedoraproject.org
Subject: [rpms/libisds] rawhide: Adapt to libxml2-2.14.0 and expat-2.9.0
Date: Thu, 29 Oct 2026 08:40:57 GMT	[thread overview]
Message-ID: <179326325721.1.11181923179299471069.rpms-libisds-b257cc3e9077@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/libisds
Branch : rawhide
Commit : b257cc3e9077b5e509cc64eaee63e158cf1ec472
Author : Petr Písař <ppisar@redhat.com>
Date   : 2026-10-29T09:38:47+01:00
Stats  : +302/-3 in 3 file(s)
URL    : https://src.fedoraproject.org/rpms/libisds/c/b257cc3e9077b5e509cc64eaee63e158cf1ec472?branch=rawhide

Log:
Adapt to libxml2-2.14.0 and expat-2.9.0

---
diff --git a/libisds-0.11.2-Do-not-use-interface-deprecated-in-expat-2.9.0.patch b/libisds-0.11.2-Do-not-use-interface-deprecated-in-expat-2.9.0.patch
new file mode 100644
index 0000000..e93310b
--- /dev/null
+++ b/libisds-0.11.2-Do-not-use-interface-deprecated-in-expat-2.9.0.patch
@@ -0,0 +1,98 @@
+From 0d8267c83315b7c2bb958b03e0ba277ee692e331 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <petr.pisar@atlas.cz>
+Date: Sun, 25 Oct 2026 18:59:42 +0100
+Subject: [PATCH] Do not use interface deprecated in expat-2.9.0
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Expat 2.9.0 deprecated functions with XML_Index type and triggered these
+deprecatation warnigs, treated by libsids by default as errors:
+
+    physxml.c: In function ‘element_start’:
+    physxml.c:129:5: error: ‘XML_GetCurrentByteIndex’ is deprecated: please use XML_GetCurrentByteIndex64 instead [-Werror=deprecated-declarations]
+      129 |     const XML_Index index = XML_GetCurrentByteIndex(data->parser);
+          |     ^~~~~
+    In file included from physxml.c:7:
+    /usr/include/expat.h:971:24: note: declared here
+      971 | XMLPARSEAPI(XML_Index) XML_GetCurrentByteIndex(XML_Parser parser);
+          |                        ^~~~~~~~~~~~~~~~~~~~~~~
+    physxml.c: In function ‘element_end’:
+    physxml.c:166:5: error: ‘XML_GetCurrentByteIndex’ is deprecated: please use XML_GetCurrentByteIndex64 instead [-Werror=deprecated-declarations]
+      166 |     const XML_Index index = (uintmax_t) XML_GetCurrentByteIndex(data->parser);
+          |     ^~~~~
+    /usr/include/expat.h:971:24: note: declared here
+      971 | XMLPARSEAPI(XML_Index) XML_GetCurrentByteIndex(XML_Parser parser);
+          |                        ^~~~~~~~~~~~~~~~~~~~~~~
+    physxml.c:167:5: error: ‘XML_GetCurrentByteCount’ is deprecated: please use XML_GetCurrentByteCount64 instead [-Werror=deprecated-declarations]
+      167 |     const int count = XML_GetCurrentByteCount(data->parser);
+          |     ^~~~~
+    /usr/include/expat.h:979:1: note: declared here
+      979 | XML_GetCurrentByteCount(XML_Parser parser);
+          | ^~~~~~~~~~~~~~~~~~~~~~~
+
+This patch adjust the code to use the new interface when built with
+expat >= 2.9.
+---
+ src/physxml.c | 25 +++++++++++++++++--------
+ 1 file changed, 17 insertions(+), 8 deletions(-)
+
+diff --git a/src/physxml.c b/src/physxml.c
+index dc6fc75..78f8fff 100644
+--- a/src/physxml.c
++++ b/src/physxml.c
+@@ -126,18 +126,22 @@ static void XMLCALL element_start(void *userData, const XML_Char *name,
+     struct expat_data *data = (struct expat_data *) userData;
+     data->depth++;
+ 
+-    const XML_Index index = XML_GetCurrentByteIndex(data->parser);
+     /* XXX: Because document length is stored as size_t, index always fits
+      * size_t. */
++#if XML_MAJOR_VERSION > 2 || (XML_MAJOR_VERSION == 2 && XML_MINOR_VERSION >= 9)
++    const size_t index = (size_t)XML_GetCurrentByteIndex64(data->parser);
++#else
++    const size_t index = (size_t)XML_GetCurrentByteIndex(data->parser);
++#endif
+     const size_t boundary = index; 
+ 
+     /* Silent warning about unused argument.
+      * This protype is expat's XML_StartElementHandler type. */
+     (void)atts;
+ 
+-    isds_log(ILF_XML, ILL_DEBUG, _("Start: name=%s, depth=%zd, offset=%#jx "
++    isds_log(ILF_XML, ILL_DEBUG, _("Start: name=%s, depth=%zd, offset=%#zx "
+             "=> boundary=%#zx\n"),
+-            name, data->depth, (uintmax_t)index, boundary);
++            name, data->depth, index, boundary);
+ 
+     if ((!data->found) &&
+             (data->depth == data->element_depth + 1) &&
+@@ -163,15 +167,20 @@ static void XMLCALL element_end(void *userData, const XML_Char *name) {
+     struct expat_data *data = (struct expat_data *) userData;
+     enum XML_Status xerr;
+ 
+-    const XML_Index index = (uintmax_t) XML_GetCurrentByteIndex(data->parser);
+-    const int count = XML_GetCurrentByteCount(data->parser);
+     /* XXX: Because document length is stored as size_t, index + count always
+      * fits size_t. */
++#if XML_MAJOR_VERSION > 2 || (XML_MAJOR_VERSION == 2 && XML_MINOR_VERSION >= 9)
++    const size_t index = (size_t)XML_GetCurrentByteIndex64(data->parser);
++    const size_t count = (size_t)XML_GetCurrentByteCount64(data->parser);
++#else
++    const size_t index = (size_t)XML_GetCurrentByteIndex(data->parser);
++    const size_t count = (size_t)XML_GetCurrentByteCount(data->parser);
++#endif
+     const size_t boundary = index + count - 1; 
+ 
+-    isds_log(ILF_XML, ILL_DEBUG, _("End:   name=%s, depth=%zd, offset=%#jx "
+-            "count=%u => boundary=%#zx\n"),
+-            name, data->depth, (uintmax_t)index, count, boundary);
++    isds_log(ILF_XML, ILL_DEBUG, _("End:   name=%s, depth=%zd, offset=%#zx "
++            "count=%zu => boundary=%#zx\n"),
++            name, data->depth, index, count, boundary);
+ 
+     if (data->element_depth == data->depth) {
+         if (data->found) {
+-- 
+2.56.0
+

diff --git a/libisds-0.11.2-Do-not-use-interface-deprecated-in-libxml2-2.14.0.patch b/libisds-0.11.2-Do-not-use-interface-deprecated-in-libxml2-2.14.0.patch
new file mode 100644
index 0000000..1a1d174
--- /dev/null
+++ b/libisds-0.11.2-Do-not-use-interface-deprecated-in-libxml2-2.14.0.patch
@@ -0,0 +1,194 @@
+From 96573c99c55de0dd65af36bde0bea2d420c48127 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <petr.pisar@atlas.cz>
+Date: Sun, 25 Oct 2026 13:05:16 +0100
+Subject: [PATCH] Do not use interface deprecated in libxml2-2.14.0
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Libxml2 deprecated accessing to fields of various data structures and
+emitted build-time warnings, by default handled as errors by
+libsids build script, like this:
+
+    isds.c: In function ‘serialize_subtree’:
+    isds.c:1977:5: error: ‘content’ is deprecated [-Werror=deprecated-declarations]
+     1977 |     *buffer = xml_buffer->content;
+          |     ^
+
+This patch adapt to the change and uses accessors instead since libxml2-2.14.0.
+---
+ src/isds.c             | 18 +++++++++++++++++-
+ src/isds_priv.h        |  1 +
+ src/soap.c             | 31 +++++++++++++++++++++++++++++--
+ test/simline/service.c | 21 +++++++++++++++++++--
+ 4 files changed, 66 insertions(+), 5 deletions(-)
+
+diff --git a/src/isds.c b/src/isds.c
+index d38fa8d..bffa3ec 100644
+--- a/src/isds.c
++++ b/src/isds.c
+@@ -1893,6 +1893,7 @@ static isds_error serialize_subtree(struct isds_ctx *context,
+     xmlNodePtr subtree_copy;
+     xmlNsPtr isds_ns;
+     void *new_buffer;
++    int xml_buffer_length;
+ 
+     if (!context) return IE_INVALID_CONTEXT;
+     if (!buffer) return IE_INVAL;
+@@ -1966,8 +1967,23 @@ static isds_error serialize_subtree(struct isds_ctx *context,
+    
+ 
+     /* Store and detach buffer from xml_buffer */
++#if LIBXML_VERSION >= 21400
++    *buffer = (void *)xmlBufferContent(xml_buffer);
++    xml_buffer_length = xmlBufferLength(xml_buffer);
++#else
+     *buffer = xml_buffer->content;
+-    *length = xml_buffer->use;
++    xml_buffer_length = xml_buffer->use;
++#endif
++    if (xml_buffer_length < 0 || xml_buffer_length > SIZE_MAX) {
++        isds_log_message(context,
++                _("A length of the serialized XML subtree does not fit into "
++                    "size_t type"));
++        err = IE_ERROR;
++        *buffer = NULL;
++        xmlBufferFree(xml_buffer);
++        goto leave;
++    }
++    *length = (size_t)xml_buffer_length;
+     xmlBufferSetAllocationScheme(xml_buffer, XML_BUFFER_ALLOC_IMMUTABLE);
+ 
+     /* Shrink buffer */
+diff --git a/src/isds_priv.h b/src/isds_priv.h
+index 29821cc..d1f39a4 100644
+--- a/src/isds_priv.h
++++ b/src/isds_priv.h
+@@ -25,6 +25,7 @@
+ #include <libxml/xpath.h>
+ #include <libxml/xpathInternals.h>
+ #include <libxml/xmlsave.h>
++#include <libxml/xmlversion.h>
+ #include "gettext.h"
+ 
+ #define _(x) ((const char *) dgettext(PACKAGE, (x)))
+diff --git a/src/soap.c b/src/soap.c
+index bc6fc9c..acfa300 100644
+--- a/src/soap.c
++++ b/src/soap.c
+@@ -1,6 +1,7 @@
+ #include "isds_priv.h"
+ #include "soap.h"
+ #include "utils.h"
++#include <stdint.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #include <strings.h>    /* strncasecmp(3) */
+@@ -1488,6 +1489,7 @@ _hidden isds_error _isds_soap(struct isds_ctx *context, const char *file,
+     long http_code = 0;
+     struct auth_headers response_otp_headers;
+     xmlBufferPtr http_request = NULL;
++    int http_request_length = 0;
+     void *http_response = NULL;
+     size_t response_length = 0;
+ 
+@@ -1509,6 +1511,18 @@ _hidden isds_error _isds_soap(struct isds_ctx *context, const char *file,
+     if (IE_SUCCESS != err) {
+         goto leave;
+     }
++#if LIBXML_VERSION >= 21400
++    http_request_length = xmlBufferLength(http_request);
++#else
++    http_request_length = http_request->use;
++#endif
++    if (http_request_length < 0 || http_request_length > SIZE_MAX) {
++        isds_log_message(context,
++                _("A length of the serialized SOAP document does not fit into "
++                    "size_t type"));
++        err = IE_ERROR;
++        goto leave;
++    }
+ 
+ 
+     if ((context->otp_credentials != NULL) || (context->mep_credentials != NULL)) {
+@@ -1520,7 +1534,14 @@ redirect:
+     }
+     isds_log(ILF_SOAP, ILL_DEBUG,
+             _("SOAP request to sent to %s:\n%.*s\nEnd of SOAP request\n"),
+-            url, http_request->use, http_request->content);
++            url,
++            http_request_length,
++#if LIBXML_VERSION >= 21400
++            (const char *)xmlBufferContent(http_request)
++#else
++            http_request->content
++#endif
++            );
+ 
+     if ((NULL != context->mep_credentials) && (NULL != context->mep_credentials->intermediate_uri)) {
+         /* POST does not work for the intermediate URI, using GET here. */
+@@ -1529,7 +1550,13 @@ redirect:
+                 &mime_type, NULL, &http_code,
+                 ((context->otp_credentials == NULL) && (context->mep_credentials == NULL)) ? NULL: &response_otp_headers);
+     } else {
+-        err = http(context, url, 0, http_request->content, http_request->use,
++        err = http(context, url, 0,
++#if LIBXML_VERSION >= 21400
++                xmlBufferContent(http_request),
++#else
++                http_request->content,
++#endif
++                (size_t)http_request_length,
+                 &http_response, &response_length,
+                 &mime_type, NULL, &http_code,
+                 ((context->otp_credentials == NULL) && (context->mep_credentials == NULL)) ? NULL: &response_otp_headers);
+diff --git a/test/simline/service.c b/test/simline/service.c
+index 42d2460..38d58bc 100644
+--- a/test/simline/service.c
++++ b/test/simline/service.c
+@@ -13,6 +13,7 @@
+ #include <libxml/xpath.h>
+ #include <libxml/xpathInternals.h>
+ #include <libxml/xmlsave.h>
++#include <libxml/xmlversion.h>
+ 
+ static const char *soap_mime_type = "text/xml"; /* SOAP/1.1 requires text/xml */
+ 
+@@ -2024,6 +2025,8 @@ void soap(const struct http_connection *connection,
+     xmlNsPtr soap_ns = NULL, isds_ns = NULL;
+     char *response_name = NULL;
+     xmlBufferPtr http_response_body = NULL;
++    int http_response_body_length = 0;
++    const void *http_response_body_content = NULL;
+     xmlSaveCtxtPtr save_ctx = NULL;
+ 
+ 
+@@ -2216,9 +2219,23 @@ void soap(const struct http_connection *connection,
+                     "Could not serialize SOAP response");
+             goto leave;
+         }
++#if LIBXML_VERSION >= 21400
++        http_response_body_length = xmlBufferLength(http_response_body);
++        http_response_body_content = xmlBufferContent(http_response_body);
++#else
++        http_response_body_length = http_response_body->use;
++        http_response_body_content = http_response_body->content;
++#endif
++        if (http_response_body_length < 0 || http_response_body_length > SIZE_MAX) {
++            http_send_response_500(connection,
++                    "A length of the serialized SOAP response does not fit "
++                    "into size_t type");
++            goto leave;
++
++        }
+ 
+-        http_send_response_200(connection, http_response_body->content,
+-                http_response_body->use, soap_mime_type);
++        http_send_response_200(connection, http_response_body_content,
++                (size_t)http_response_body_length, soap_mime_type);
+     }
+ 
+ leave:
+-- 
+2.56.0
+

diff --git a/libisds.spec b/libisds.spec
index d5cac48..9b3a2f2 100644
--- a/libisds.spec
+++ b/libisds.spec
@@ -9,7 +9,7 @@
 
 Name:           libisds
 Version:        0.11.2
-Release:        18%{?dist}
+Release:        19%{?dist}
 Summary:        Library for accessing the Czech Data Boxes
 # COPYING:      LGPL-3.0 text
 # README:       LGPL-3.0-or-later
@@ -72,8 +72,12 @@ Patch2:         libisds-0.11.2-client-sendxmldoc-Fix-a-use-after-free-on-two-pla
 Patch3:         libisds-0.11.2-Fix-building-with-libxml2-2.12.0.patch
 # Fix reporting an amount of transferred data, in upstream after 0.11.0
 Patch4:         libisds-0.11.2-Fix-using-CURLOPT_XFERINFOFUNCTION-curl-option.patch
-# Fix building with curl-8.14.0
+# Fix building with curl-8.14.0, in upstream after 0.11.2
 Patch5:         libisds-0.11.2-Fix-passing-integers-to-curl_easy_setopt.patch
+# Fix building with libxml2-2.14.0, in upstream after 0.11.2
+Patch6:         libisds-0.11.2-Do-not-use-interface-deprecated-in-libxml2-2.14.0.patch
+# Fix building with expat-2.9.0, in upstream after 0.11.2
+Patch7:         libisds-0.11.2-Do-not-use-interface-deprecated-in-expat-2.9.0.patch
 BuildRequires:  autoconf
 BuildRequires:  automake
 BuildRequires:  coreutils
@@ -157,7 +161,7 @@ autoreconf -fi
     --without-libcurl \
 %endif
     --enable-curlreauthorizationbug
-%{make_build} CFLAGS="$CFLAGS -Wdeprecated-declarations"
+%{make_build}
 
 %check
 make check %{?_smp_mflags}
@@ -184,6 +188,9 @@ rm -rf client/.deps client/Makefile{,.in}
 %doc client
 
 %changelog
+* Tue Oct 27 2026 Petr Pisar <ppisar@redhat.com> - 0.11.2-19
+- Adapt to libxml2-2.14.0 and expat-2.9.0
+
 * Fri Oct 23 2026 Petr Pisar <ppisar@redhat.com> - 0.11.2-18
 - Verify upstream signature with openpgpverify
 

                 reply	other threads:[~2026-10-29  8:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179326325721.1.11181923179299471069.rpms-libisds-b257cc3e9077@fedoraproject.org \
    --to=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox