From 7b373fa3c7fbc99a5ba5d495653394a57712657d Mon Sep 17 00:00:00 2001 From: Michal Schorm Date: Mon, 30 Mar 2026 15:44:57 +0200 Subject: [PATCH 1/6] [bugfix] Move ODBC plugin libtdsodbc.so to '%{_libdir}/odbc/' (rhbz#2453060) Move the ODBC driver symlink 'libtdsodbc.so' from '%{_libdir}/' to '%{_libdir}/odbc/' to keep ODBC driver plugins out of the bare library directory. The 'odbc/' subdirectory name is driver-manager-neutral and consistent with Debian's convention and mdbtools-odbc in Fedora. The versioned 'libtdsodbc.so.0' stays in '%{_libdir}/' (in '-libs') because freetds links against it at build time. Only the unversioned symlink (used as an ODBC plugin entry point) moves to the subdirectory. Related: rhbz#2453060 Co-Authored-By: Claude AI --- freetds.spec | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/freetds.spec b/freetds.spec index 80872c5..b3c14f0 100644 --- a/freetds.spec +++ b/freetds.spec @@ -3,7 +3,7 @@ Name: freetds Summary: Implementation of the TDS (Tabular DataStream) protocol Version: 1.4.23 -Release: 4%{?dist} +Release: 5%{?dist} # Automatically converted from old format: LGPLv2+ and GPLv2+ - review is highly recommended. License: LGPL-2.0-or-later AND GPL-2.0-or-later URL: http://www.freetds.org/ @@ -99,6 +99,13 @@ make install DESTDIR=$RPM_BUILD_ROOT rm -f $RPM_BUILD_ROOT%{_libdir}/*.la chmod -x $RPM_BUILD_ROOT%{_sysconfdir}/* +# Move ODBC plugin to a dedicated subdirectory (rhbz#2453060) +# libtdsodbc.so is a symlink to libtdsodbc.so.0 -- recreate it with +# a correct relative path from the subdirectory back to the parent +mkdir -p $RPM_BUILD_ROOT%{_libdir}/odbc +unlink $RPM_BUILD_ROOT%{_libdir}/libtdsodbc.so +ln -s ../libtdsodbc.so.0 $RPM_BUILD_ROOT%{_libdir}/odbc/libtdsodbc.so + mv -f $RPM_BUILD_ROOT%{_includedir}/tds_sysdep_public.h \ $RPM_BUILD_ROOT%{_includedir}/tds_sysdep_public_%{bits}.h install -p -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_includedir}/tds_sysdep_public.h @@ -131,7 +138,8 @@ find docdir -type f -print0 | xargs -0 chmod -x %files libs %license COPYING_LIB.txt %{_libdir}/*.so.* -%{_libdir}/libtdsodbc.so +%dir %{_libdir}/odbc +%{_libdir}/odbc/libtdsodbc.so %doc samples-odbc %config(noreplace) %{_sysconfdir}/*.conf %{_mandir}/man5/* @@ -141,7 +149,7 @@ find docdir -type f -print0 | xargs -0 chmod -x %license COPYING_LIB.txt %doc samples %{_libdir}/*.so -%exclude %{_libdir}/libtdsodbc.so +%exclude %{_libdir}/odbc/libtdsodbc.so %{_includedir}/* @@ -150,6 +158,9 @@ find docdir -type f -print0 | xargs -0 chmod -x %changelog +* Mon Mar 30 2026 Michal Schorm - 1.4.23-5 +- Move ODBC plugin libtdsodbc.so to %%{_libdir}/odbc/ (rhbz#2453060) + * Fri Jan 16 2026 Fedora Release Engineering - 1.4.23-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild From bbe3fd78e554a460c3f1601822bb9ee494b96bd3 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 15 Jul 2026 23:28:07 +0000 Subject: [PATCH 2/6] Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild --- freetds.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/freetds.spec b/freetds.spec index b3c14f0..dfc0d01 100644 --- a/freetds.spec +++ b/freetds.spec @@ -3,7 +3,7 @@ Name: freetds Summary: Implementation of the TDS (Tabular DataStream) protocol Version: 1.4.23 -Release: 5%{?dist} +Release: 6%{?dist} # Automatically converted from old format: LGPLv2+ and GPLv2+ - review is highly recommended. License: LGPL-2.0-or-later AND GPL-2.0-or-later URL: http://www.freetds.org/ @@ -158,6 +158,9 @@ find docdir -type f -print0 | xargs -0 chmod -x %changelog +* Wed Jul 15 2026 Fedora Release Engineering - 1.4.23-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild + * Mon Mar 30 2026 Michal Schorm - 1.4.23-5 - Move ODBC plugin libtdsodbc.so to %%{_libdir}/odbc/ (rhbz#2453060) From 82aca510e3a281644aa1a5f10bd781296b6d788b Mon Sep 17 00:00:00 2001 From: Michal Schorm Date: Wed, 29 Jul 2026 12:40:28 +0200 Subject: [PATCH 3/6] [bugfix] Fix FTBFS with nettle 4.0: digest functions changed signature Nettle 4.0 (in Fedora 45) changed 'md5_digest()' and 'md4_digest()' from 3 arguments '(ctx, length, digest)' to 2 arguments '(ctx, digest)'. The digest length is now implicit (always the algorithm's native size). FreeTDS wraps the nettle API in inline functions in 'include/freetds/utils/md5.h' and 'include/freetds/utils/md4.h'. Both called 'nettle_md5_digest(ctx, 16, digest)' and 'nettle_md4_digest(ctx, 16, digest)' respectively, which no longer compiles: error: too many arguments to function 'nettle_md5_digest'; expected 2, have 3 Drop the now-removed length argument from both call sites. Co-Authored-By: Claude AI --- freetds-1.4.23-nettle4.patch | 22 ++++++++++++++++++++++ freetds.spec | 3 +++ 2 files changed, 25 insertions(+) create mode 100644 freetds-1.4.23-nettle4.patch diff --git a/freetds-1.4.23-nettle4.patch b/freetds-1.4.23-nettle4.patch new file mode 100644 index 0000000..a7b7a78 --- /dev/null +++ b/freetds-1.4.23-nettle4.patch @@ -0,0 +1,22 @@ +--- a/include/freetds/utils/md4.h ++++ b/include/freetds/utils/md4.h +@@ -38,7 +38,7 @@ static inline void MD4Update(MD4_CTX *ctx, const uint8_t *buf, size_t len) + + static inline void MD4Final(MD4_CTX *ctx, uint8_t *digest) + { +- nettle_md4_digest(ctx, 16, digest); ++ nettle_md4_digest(ctx, digest); + } + + +--- a/include/freetds/utils/md5.h ++++ b/include/freetds/utils/md5.h +@@ -40,7 +40,7 @@ static inline void MD5Update(MD5_CTX *ctx, const uint8_t *buf, size_t len) + + static inline void MD5Final(MD5_CTX *ctx, uint8_t *digest) + { +- nettle_md5_digest(ctx, 16, digest); ++ nettle_md5_digest(ctx, digest); + } + + #endif diff --git a/freetds.spec b/freetds.spec index dfc0d01..852e39d 100644 --- a/freetds.spec +++ b/freetds.spec @@ -11,6 +11,8 @@ URL: http://www.freetds.org/ Source0: https://www.freetds.org/files/stable/%{name}-%{version}.tar.bz2 Source1: freetds-tds_sysdep_public.h +Patch0: freetds-1.4.23-nettle4.patch + BuildRequires: unixODBC-devel, readline-devel, gnutls-devel, krb5-devel BuildRequires: libgcrypt-devel BuildRequires: libtool @@ -61,6 +63,7 @@ If you like to develop programs using %{name}, you will need to install %prep %setup -q +%patch -P0 -p1 # correct perl path sed -i '1 s,#!.*/perl,#!%{__perl},' samples/*.pl From 2bc4071fb03c5721b5e7181df2134a7621f1c2d9 Mon Sep 17 00:00:00 2001 From: Michal Schorm Date: Mon, 13 Jul 2026 01:02:38 +0200 Subject: [PATCH 4/6] [Fedora 45 Change] Ship drop-in snippet for ODBC driver self-registration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Install '10-freetds.ini' to '/usr/lib/odbc/odbcinst.d/' so the unixODBC file trigger automatically registers the driver in '/etc/odbcinst.ini'. Uses bare library name 'libtdsodbc.so' resolved via the compiled-in MODULEDIR. Snippet directory layout: - Snippets are installed to '%{_prefix}/lib/odbc/odbcinst.d/' rather than directly to '%{_prefix}/lib/odbc/' to separate configuration from content — on multilib systems, '%{_prefix}/lib/odbc/' may also contain 32-bit driver '.so' files, and the RPM file triggers that watch the snippet directory would fire spuriously on '.so' installs - Both '%{_prefix}/lib/odbc/' and '%{_prefix}/lib/odbc/odbcinst.d/' are co-owned by this package per Fedora directory ownership guidelines Co-Authored-By: Claude AI This commit is part of a Fedora 45 Self Contained Change: https://fedoraproject.org/wiki/Changes/ODBC_stack_modernization --- 10-freetds.ini | 3 +++ freetds.spec | 13 ++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 10-freetds.ini diff --git a/10-freetds.ini b/10-freetds.ini new file mode 100644 index 0000000..8d0cd9b --- /dev/null +++ b/10-freetds.ini @@ -0,0 +1,3 @@ +[FreeTDS] +Description = Free Sybase & MS SQL Driver +Driver = libtdsodbc.so diff --git a/freetds.spec b/freetds.spec index 852e39d..eccb6b7 100644 --- a/freetds.spec +++ b/freetds.spec @@ -3,13 +3,14 @@ Name: freetds Summary: Implementation of the TDS (Tabular DataStream) protocol Version: 1.4.23 -Release: 6%{?dist} +Release: 7%{?dist} # Automatically converted from old format: LGPLv2+ and GPLv2+ - review is highly recommended. License: LGPL-2.0-or-later AND GPL-2.0-or-later URL: http://www.freetds.org/ Source0: https://www.freetds.org/files/stable/%{name}-%{version}.tar.bz2 Source1: freetds-tds_sysdep_public.h +Source2: 10-freetds.ini Patch0: freetds-1.4.23-nettle4.patch @@ -121,6 +122,10 @@ mv -f samples/unixodbc.freetds.driver.template \ mkdir samples-odbc mv -f samples/*odbc* samples-odbc +# ODBC driver registration drop-in snippet +mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/odbc/odbcinst.d +install -m644 %{SOURCE2} $RPM_BUILD_ROOT%{_prefix}/lib/odbc/odbcinst.d/ + # deinstall it for our own way... mv -f $RPM_BUILD_ROOT%{_docdir}/%{name} docdir find docdir -type f -print0 | xargs -0 chmod -x @@ -143,6 +148,9 @@ find docdir -type f -print0 | xargs -0 chmod -x %{_libdir}/*.so.* %dir %{_libdir}/odbc %{_libdir}/odbc/libtdsodbc.so +%dir %{_prefix}/lib/odbc +%dir %{_prefix}/lib/odbc/odbcinst.d +%{_prefix}/lib/odbc/odbcinst.d/10-freetds.ini %doc samples-odbc %config(noreplace) %{_sysconfdir}/*.conf %{_mandir}/man5/* @@ -161,6 +169,9 @@ find docdir -type f -print0 | xargs -0 chmod -x %changelog +* Mon Jul 20 2026 Michal Schorm - 1.4.23-7 +- Ship drop-in snippet for ODBC driver self-registration + * Wed Jul 15 2026 Fedora Release Engineering - 1.4.23-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild From e1705a147ff8ea8a26afe612df347cf9109b6008 Mon Sep 17 00:00:00 2001 From: Michal Schorm Date: Wed, 29 Jul 2026 14:18:33 +0200 Subject: [PATCH 5/6] [bugfix] Fix FTBFS with nettle 4.0: 'sha1_digest()' also lost length parameter The existing nettle 4.0 patch fixed 'nettle_md4_digest()' and 'nettle_md5_digest()' but missed 'sha1_digest()' in 'sec_negotiate_gnutls.h', which also dropped the length parameter in nettle 4.0. Replace the unconditional patch with version-guarded '#ifdef' blocks matching upstream commit 67663a0 ("Fix compatibility with Nettle 4 library"), covering all three digest functions with backwards compatibility for nettle < 4. Co-Authored-By: Claude AI --- freetds-1.4.23-nettle4.patch | 52 +++++++++++++++++++++++++++++++++--- freetds.spec | 5 +++- 2 files changed, 52 insertions(+), 5 deletions(-) diff --git a/freetds-1.4.23-nettle4.patch b/freetds-1.4.23-nettle4.patch index a7b7a78..770ff34 100644 --- a/freetds-1.4.23-nettle4.patch +++ b/freetds-1.4.23-nettle4.patch @@ -1,22 +1,66 @@ --- a/include/freetds/utils/md4.h +++ b/include/freetds/utils/md4.h -@@ -38,7 +38,7 @@ static inline void MD4Update(MD4_CTX *ctx, const uint8_t *buf, size_t len) +@@ -23,6 +23,7 @@ typedef struct MD4Context MD4_CTX; + #else + + #include ++#include + + typedef struct md4_ctx MD4_CTX; + +@@ -38,7 +39,11 @@ static inline void MD4Update(MD4_CTX *ctx, const uint8_t *buf, size_t len) static inline void MD4Final(MD4_CTX *ctx, uint8_t *digest) { -- nettle_md4_digest(ctx, 16, digest); ++#if defined(NETTLE_VERSION_MAJOR) && NETTLE_VERSION_MAJOR >= 4 + nettle_md4_digest(ctx, digest); ++#else + nettle_md4_digest(ctx, 16, digest); ++#endif } --- a/include/freetds/utils/md5.h +++ b/include/freetds/utils/md5.h -@@ -40,7 +40,7 @@ static inline void MD5Update(MD5_CTX *ctx, const uint8_t *buf, size_t len) +@@ -25,6 +25,7 @@ typedef struct md5_ctx MD5_CTX; + #else + + #include ++#include + + typedef struct md5_ctx MD5_CTX; + +@@ -40,7 +41,11 @@ static inline void MD5Update(MD5_CTX *ctx, const uint8_t *buf, size_t len) static inline void MD5Final(MD5_CTX *ctx, uint8_t *digest) { -- nettle_md5_digest(ctx, 16, digest); ++#if defined(NETTLE_VERSION_MAJOR) && NETTLE_VERSION_MAJOR >= 4 + nettle_md5_digest(ctx, digest); ++#else + nettle_md5_digest(ctx, 16, digest); ++#endif } #endif +--- a/src/tds/sec_negotiate_gnutls.h ++++ b/src/tds/sec_negotiate_gnutls.h +@@ -35,6 +35,7 @@ + # include + # include + # include ++# include + #endif + + /** +@@ -186,7 +187,11 @@ sha1(uint8_t *hash, const void *data, size_t len) + struct sha1_ctx ctx; + sha1_init(&ctx); + sha1_update(&ctx, len, (const uint8_t *) data); ++#if defined(NETTLE_VERSION_MAJOR) && NETTLE_VERSION_MAJOR >= 4 ++ sha1_digest(&ctx, hash); ++#else + sha1_digest(&ctx, 20, hash); ++#endif + } + #endif + diff --git a/freetds.spec b/freetds.spec index eccb6b7..a2a3013 100644 --- a/freetds.spec +++ b/freetds.spec @@ -3,7 +3,7 @@ Name: freetds Summary: Implementation of the TDS (Tabular DataStream) protocol Version: 1.4.23 -Release: 7%{?dist} +Release: 8%{?dist} # Automatically converted from old format: LGPLv2+ and GPLv2+ - review is highly recommended. License: LGPL-2.0-or-later AND GPL-2.0-or-later URL: http://www.freetds.org/ @@ -169,6 +169,9 @@ find docdir -type f -print0 | xargs -0 chmod -x %changelog +* Wed Jul 29 2026 Michal Schorm - 1.4.23-8 +- Fix FTBFS with nettle 4.0: 'sha1_digest()' also lost length parameter + * Mon Jul 20 2026 Michal Schorm - 1.4.23-7 - Ship drop-in snippet for ODBC driver self-registration From 3ef1461967e6b4a0d13d482afd452fad3a8bc040 Mon Sep 17 00:00:00 2001 From: Dmitry Butskoy Date: Tue, 11 Aug 2026 22:03:54 +0300 Subject: [PATCH 6/6] Update to 1.5.18 --- freetds-1.4.23-nettle4.patch | 66 ------------------------------------ freetds.spec | 10 +++--- sources | 2 +- 3 files changed, 6 insertions(+), 72 deletions(-) delete mode 100644 freetds-1.4.23-nettle4.patch diff --git a/freetds-1.4.23-nettle4.patch b/freetds-1.4.23-nettle4.patch deleted file mode 100644 index 770ff34..0000000 --- a/freetds-1.4.23-nettle4.patch +++ /dev/null @@ -1,66 +0,0 @@ ---- a/include/freetds/utils/md4.h -+++ b/include/freetds/utils/md4.h -@@ -23,6 +23,7 @@ typedef struct MD4Context MD4_CTX; - #else - - #include -+#include - - typedef struct md4_ctx MD4_CTX; - -@@ -38,7 +39,11 @@ static inline void MD4Update(MD4_CTX *ctx, const uint8_t *buf, size_t len) - - static inline void MD4Final(MD4_CTX *ctx, uint8_t *digest) - { -+#if defined(NETTLE_VERSION_MAJOR) && NETTLE_VERSION_MAJOR >= 4 -+ nettle_md4_digest(ctx, digest); -+#else - nettle_md4_digest(ctx, 16, digest); -+#endif - } - - ---- a/include/freetds/utils/md5.h -+++ b/include/freetds/utils/md5.h -@@ -25,6 +25,7 @@ typedef struct md5_ctx MD5_CTX; - #else - - #include -+#include - - typedef struct md5_ctx MD5_CTX; - -@@ -40,7 +41,11 @@ static inline void MD5Update(MD5_CTX *ctx, const uint8_t *buf, size_t len) - - static inline void MD5Final(MD5_CTX *ctx, uint8_t *digest) - { -+#if defined(NETTLE_VERSION_MAJOR) && NETTLE_VERSION_MAJOR >= 4 -+ nettle_md5_digest(ctx, digest); -+#else - nettle_md5_digest(ctx, 16, digest); -+#endif - } - - #endif ---- a/src/tds/sec_negotiate_gnutls.h -+++ b/src/tds/sec_negotiate_gnutls.h -@@ -35,6 +35,7 @@ - # include - # include - # include -+# include - #endif - - /** -@@ -186,7 +187,11 @@ sha1(uint8_t *hash, const void *data, size_t len) - struct sha1_ctx ctx; - sha1_init(&ctx); - sha1_update(&ctx, len, (const uint8_t *) data); -+#if defined(NETTLE_VERSION_MAJOR) && NETTLE_VERSION_MAJOR >= 4 -+ sha1_digest(&ctx, hash); -+#else - sha1_digest(&ctx, 20, hash); -+#endif - } - #endif - diff --git a/freetds.spec b/freetds.spec index a2a3013..7383f76 100644 --- a/freetds.spec +++ b/freetds.spec @@ -2,8 +2,8 @@ Name: freetds Summary: Implementation of the TDS (Tabular DataStream) protocol -Version: 1.4.23 -Release: 8%{?dist} +Version: 1.5.18 +Release: 1%{?dist} # Automatically converted from old format: LGPLv2+ and GPLv2+ - review is highly recommended. License: LGPL-2.0-or-later AND GPL-2.0-or-later URL: http://www.freetds.org/ @@ -12,8 +12,6 @@ Source0: https://www.freetds.org/files/stable/%{name}-%{version}.tar.bz2 Source1: freetds-tds_sysdep_public.h Source2: 10-freetds.ini -Patch0: freetds-1.4.23-nettle4.patch - BuildRequires: unixODBC-devel, readline-devel, gnutls-devel, krb5-devel BuildRequires: libgcrypt-devel BuildRequires: libtool @@ -64,7 +62,6 @@ If you like to develop programs using %{name}, you will need to install %prep %setup -q -%patch -P0 -p1 # correct perl path sed -i '1 s,#!.*/perl,#!%{__perl},' samples/*.pl @@ -169,6 +166,9 @@ find docdir -type f -print0 | xargs -0 chmod -x %changelog +* Tue Aug 11 2026 Dmitry Butskoy - 1.5.18-1 +- update to 1.5.18 (#2513794) + * Wed Jul 29 2026 Michal Schorm - 1.4.23-8 - Fix FTBFS with nettle 4.0: 'sha1_digest()' also lost length parameter diff --git a/sources b/sources index d8018db..f2c9a79 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (freetds-1.4.23.tar.bz2) = 9b51b21d9c5dc7cac3d9fdccb3a600a6b3b2a0df6f7a0396497ba3377c9a6925b3e4ea3dfbb671bd4563c321692bea82c6f70c2ccefb30eaa0d006ebd3aac249 +SHA512 (freetds-1.5.18.tar.bz2) = 9410b992d5b6a2bede00a6e81256b9f426d1477d7b9a2ea74c0481b2a5c3840c35171916a24f7820e101bfc44cf67dbf7c6c5d69010415c19178d91e7949859e