public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/bacula] epel10: Make it build on el8/el9
@ 2026-11-08 17:46 Simone Caronni
  0 siblings, 0 replies; only message in thread
From: Simone Caronni @ 2026-11-08 17:46 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/bacula
Branch : epel10
Commit : 1a07f57cc442a769a4b07da3c5109b72dd312f1c
Author : Simone Caronni <negativo17@gmail.com>
Date   : 2026-11-08T18:44:49+01:00
Stats  : +32/-15 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/bacula/c/1a07f57cc442a769a4b07da3c5109b72dd312f1c?branch=epel10

Log:
Make it build on el8/el9

---
diff --git a/bacula-openssl4.patch b/bacula-openssl4.patch
index e2395ef..0074a23 100644
--- a/bacula-openssl4.patch
+++ b/bacula-openssl4.patch
@@ -3,13 +3,15 @@ From: Finn Rayk Gaertner <finn.gartner@canonical.com>
 Date: Fri, 31 Jul 2026 04:25:48 +0200
 Subject: [PATCH] OpenSSL 4.0 compatibility
 
+Fedora: cast the X509_NAME arguments of X509_NAME_get_text_by_NID() and
+X509_NAME_get_index_by_NID(), which are not const in OpenSSL 1.1.1 (EL8).
 ---
- bacula/src/lib/crypto.c |  6 +++---
- bacula/src/lib/tls.c    | 27 +++++++++++++++------------
- 2 files changed, 18 insertions(+), 15 deletions(-)
+ src/lib/crypto.c |  6 +++---
+ src/lib/tls.c    | 31 +++++++++++++++++--------------
+ 2 files changed, 20 insertions(+), 17 deletions(-)
 
 diff --git a/src/lib/crypto.c b/src/lib/crypto.c
-index dd7a2f982..8913f695c 100644
+index c6c0abe..52fe1b4 100644
 --- a/src/lib/crypto.c
 +++ b/src/lib/crypto.c
 @@ -309,7 +309,7 @@ typedef struct PEM_CB_Context {
@@ -36,10 +38,10 @@ index dd7a2f982..8913f695c 100644
  
     if (method->it) {
 diff --git a/src/lib/tls.c b/src/lib/tls.c
-index 398577997..77499434d 100644
+index 493e8a0..ef32c4c 100644
 --- a/src/lib/tls.c
 +++ b/src/lib/tls.c
-@@ -484,7 +484,7 @@ bool tls_postconnect_verify_cn(JCR *jcr, TLS_CONNECTION *tls, alist *verify_list
+@@ -481,7 +481,7 @@ bool tls_postconnect_verify_cn(JCR *jcr, TLS_CONNECTION *tls, alist *verify_list
  {
     SSL *ssl = tls->openssl;
     X509 *cert;
@@ -48,7 +50,16 @@ index 398577997..77499434d 100644
     bool auth_success = false;
     char data[256];
  
-@@ -523,15 +523,15 @@ bool tls_postconnect_verify_host(JCR *jcr, TLS_CONNECTION *tls, const char *host
+@@ -492,7 +492,7 @@ bool tls_postconnect_verify_cn(JCR *jcr, TLS_CONNECTION *tls, alist *verify_list
+    }
+ 
+    if ((subject = X509_get_subject_name(cert)) != NULL) {
+-      if (X509_NAME_get_text_by_NID(subject, NID_commonName, data, sizeof(data)) > 0) {
++      if (X509_NAME_get_text_by_NID((X509_NAME *)subject, NID_commonName, data, sizeof(data)) > 0) {
+          char *cn;
+          /* NULL terminate data */
+          data[255] = 0;
+@@ -520,15 +520,15 @@ bool tls_postconnect_verify_host(JCR *jcr, TLS_CONNECTION *tls, const char *host
  {
     SSL *ssl = tls->openssl;
     X509 *cert;
@@ -67,7 +78,7 @@ index 398577997..77499434d 100644
  
     /* Check if peer provided a certificate */
     if (!(cert = SSL_get_peer_certificate(ssl))) {
-@@ -544,11 +544,11 @@ bool tls_postconnect_verify_host(JCR *jcr, TLS_CONNECTION *tls, const char *host
+@@ -541,11 +541,11 @@ bool tls_postconnect_verify_host(JCR *jcr, TLS_CONNECTION *tls, const char *host
     /* Check subjectAltName extensions first */
     if ((extensions = X509_get_ext_count(cert)) > 0) {
        for (i = 0; i < extensions; i++) {
@@ -81,7 +92,7 @@ index 398577997..77499434d 100644
  
           if (strcmp(extname, "subjectAltName") == 0) {
  #if (OPENSSL_VERSION_NUMBER >= 0x10000000L)
-@@ -563,11 +563,11 @@ bool tls_postconnect_verify_host(JCR *jcr, TLS_CONNECTION *tls, const char *host
+@@ -560,11 +560,11 @@ bool tls_postconnect_verify_host(JCR *jcr, TLS_CONNECTION *tls, const char *host
              const ASN1_STRING *asn1_ext_val;
  
              /* Get x509 extension method structure */
@@ -95,13 +106,14 @@ index 398577997..77499434d 100644
              ext_value_data = ASN1_STRING_get0_data(asn1_ext_val);
  
              if (method->it) {
-@@ -622,26 +622,29 @@ bool tls_postconnect_verify_host(JCR *jcr, TLS_CONNECTION *tls, const char *host
+@@ -619,26 +619,29 @@ bool tls_postconnect_verify_host(JCR *jcr, TLS_CONNECTION *tls, const char *host
        if ((subject = X509_get_subject_name(cert)) != NULL) {
           /* Loop through all CNs */
           for (;;) {
+-            cnLastPos = X509_NAME_get_index_by_NID(subject, NID_commonName, cnLastPos);
 +            const char *cnval;
 +
-             cnLastPos = X509_NAME_get_index_by_NID(subject, NID_commonName, cnLastPos);
++            cnLastPos = X509_NAME_get_index_by_NID((X509_NAME *)subject, NID_commonName, cnLastPos);
              if (cnLastPos == -1) {
                 break;
              }
@@ -129,5 +141,3 @@ index 398577997..77499434d 100644
           }
        }
     }
--- 
-2.53.0

diff --git a/bacula.spec b/bacula.spec
index 3ddfd96..caf2078 100644
--- a/bacula.spec
+++ b/bacula.spec
@@ -3,6 +3,13 @@
 %global shortcommit %(c=%{commit}; echo ${c:0:7})
 
 %global uid 133
+
+# GCC 8 does not know about -Wattribute-warning
+%if 0%{?rhel} == 8
+%global warning_flags %{nil}
+%else
+%global warning_flags -Wno-error=attribute-warning
+%endif
 %global username bacula
 
 Name:               bacula
@@ -282,8 +289,8 @@ find updatedb -type f | xargs chmod -x
 
 %build
 %set_build_flags
-export CFLAGS="%{optflags} -fPIC -Wno-error=attribute-warning -I%{_includedir}/ncurses"
-export CXXFLAGS="%{optflags} -fPIC -Wno-error=attribute-warning -I%{_includedir}/ncurses"
+export CFLAGS="%{optflags} -fPIC %{warning_flags} -I%{_includedir}/ncurses"
+export CXXFLAGS="%{optflags} -fPIC %{warning_flags} -I%{_includedir}/ncurses"
 export PATH="$PATH:%{_qt5_bindir}"
 
 pushd libs3-%{commit}

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-08 17:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-08 17:46 [rpms/bacula] epel10: Make it build on el8/el9 Simone Caronni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox