Compare commits
10 Commits
0e9d28a461
...
6de801c950
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6de801c950 | ||
|
|
229c7b8ed8 | ||
|
|
64eb19878b | ||
|
|
29f31c05b2 | ||
|
|
4aea6ca6bd | ||
|
|
e5333fb7ff | ||
|
|
3af1eb375b | ||
|
|
ad76d0d8a0 | ||
|
|
23ee4d67b7 | ||
|
|
47f88dbfda |
30
CVE-2019-13508.patch
Normal file
30
CVE-2019-13508.patch
Normal file
@ -0,0 +1,30 @@
|
||||
From 0df4eb82a0e3ff844e373d7c9f9c6c813925e2ac Mon Sep 17 00:00:00 2001
|
||||
From: Frediano Ziglio <freddy77@gmail.com>
|
||||
Date: Tue, 9 Jul 2019 09:26:43 +0100
|
||||
Subject: [PATCH] tds: Make sure UDT has varint set to 8
|
||||
|
||||
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
|
||||
---
|
||||
src/tds/data.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/src/tds/data.c b/src/tds/data.c
|
||||
index c10ebe1ca..0c5e90f95 100644
|
||||
--- a/src/tds/data.c
|
||||
+++ b/src/tds/data.c
|
||||
@@ -1425,6 +1425,7 @@ tds_clrudt_get_info(TDSSOCKET * tds, TDSCOLUMN * col)
|
||||
tds_get_string(tds, tds_get_usmallint(tds), NULL, 0);
|
||||
|
||||
col->column_size = 0x7ffffffflu;
|
||||
+ col->column_varint_size = 8;
|
||||
|
||||
return TDS_SUCCESS;
|
||||
}
|
||||
@@ -1432,6 +1433,7 @@ tds_clrudt_get_info(TDSSOCKET * tds, TDSCOLUMN * col)
|
||||
TDS_INT
|
||||
tds_clrudt_row_len(TDSCOLUMN *col)
|
||||
{
|
||||
+ col->column_varint_size = 8;
|
||||
/* TODO save other fields */
|
||||
return sizeof(TDSBLOB);
|
||||
}
|
||||
60
Fix-some-collation-encoding-detection.patch
Normal file
60
Fix-some-collation-encoding-detection.patch
Normal file
@ -0,0 +1,60 @@
|
||||
From ee60a8809aad1c632cf7e492ab0336ff7dde9843 Mon Sep 17 00:00:00 2001
|
||||
From: Frediano Ziglio <freddy77@gmail.com>
|
||||
Date: Fri, 1 Mar 2019 09:55:07 +0000
|
||||
Subject: [PATCH] Fix some collation encoding detection
|
||||
|
||||
Serbian_Latin_100 is CP1250.
|
||||
Bashkir_100, Bosnian_Cyrillic_100 and Yakut_100 are CP1251.
|
||||
|
||||
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
|
||||
---
|
||||
src/tds/iconv.c | 9 ++++-----
|
||||
1 file changed, 4 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/src/tds/iconv.c b/src/tds/iconv.c
|
||||
index 5aa9ce9f..5b828fa1 100644
|
||||
--- a/src/tds/iconv.c
|
||||
+++ b/src/tds/iconv.c
|
||||
@@ -1033,7 +1033,7 @@ collate2charset(int sql_collate, int lcid)
|
||||
case 0x41c:
|
||||
case 0x424:
|
||||
case 0x442:
|
||||
- /* case 0x81a: seem wrong in XP table TODO check */
|
||||
+ case 0x81a:
|
||||
case 0x104e: /* ?? */
|
||||
case 0x141a:
|
||||
cp = TDS_CHARSET_CP1250;
|
||||
@@ -1047,10 +1047,12 @@ collate2charset(int sql_collate, int lcid)
|
||||
case 0x440:
|
||||
case 0x444:
|
||||
case 0x450:
|
||||
- case 0x81a: /* ?? */
|
||||
case 0x82c:
|
||||
case 0x843:
|
||||
case 0xc1a:
|
||||
+ case 0x46d:
|
||||
+ case 0x201a:
|
||||
+ case 0x485:
|
||||
cp = TDS_CHARSET_CP1251;
|
||||
break;
|
||||
case 0x1007:
|
||||
@@ -1066,7 +1068,6 @@ collate2charset(int sql_collate, int lcid)
|
||||
case 0x180c:
|
||||
case 0x1c09:
|
||||
case 0x1c0a:
|
||||
- case 0x201a:
|
||||
case 0x2009:
|
||||
case 0x200a:
|
||||
case 0x2409:
|
||||
@@ -1114,8 +1115,6 @@ collate2charset(int sql_collate, int lcid)
|
||||
case 0x440a:
|
||||
case 0x441:
|
||||
case 0x456:
|
||||
- case 0x46d:
|
||||
- case 0x485:
|
||||
case 0x480a:
|
||||
case 0x4c0a:
|
||||
case 0x500a:
|
||||
--
|
||||
2.27.0
|
||||
|
||||
28
ctlib-Fix-cs_will_convert.patch
Normal file
28
ctlib-Fix-cs_will_convert.patch
Normal file
@ -0,0 +1,28 @@
|
||||
From 84f3ff1d8f76ba6f764a6b2fa164c40aba54c28a Mon Sep 17 00:00:00 2001
|
||||
From: Frediano Ziglio <freddy77@gmail.com>
|
||||
Date: Sun, 17 Mar 2019 19:02:35 +0000
|
||||
Subject: [PATCH] ctlib: Fix cs_will_convert
|
||||
|
||||
Use CT-Library types, not TDS ones.
|
||||
|
||||
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
|
||||
---
|
||||
src/ctlib/cs.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/src/ctlib/cs.c b/src/ctlib/cs.c
|
||||
index 30dd2de0..70c314c1 100644
|
||||
--- a/src/ctlib/cs.c
|
||||
+++ b/src/ctlib/cs.c
|
||||
@@ -1293,6 +1293,8 @@ cs_will_convert(CS_CONTEXT * ctx, CS_INT srctype, CS_INT desttype, CS_BOOL * res
|
||||
|
||||
tdsdump_log(TDS_DBG_FUNC, "cs_will_convert(%p, %d, %d, %p)\n", ctx, srctype, desttype, result);
|
||||
|
||||
+ srctype = _ct_get_server_type(NULL, srctype);
|
||||
+ desttype = _ct_get_server_type(NULL, desttype);
|
||||
*result = (tds_willconvert(srctype, desttype) ? CS_TRUE : CS_FALSE);
|
||||
return CS_SUCCEED;
|
||||
}
|
||||
--
|
||||
2.27.0
|
||||
|
||||
27
dblib-Address-compiler-warning.patch
Normal file
27
dblib-Address-compiler-warning.patch
Normal file
@ -0,0 +1,27 @@
|
||||
From 395e3db9f505322918999081981a212dc51c5cfc Mon Sep 17 00:00:00 2001
|
||||
From: "Aaron M. Ucko" <ucko@ncbi.nlm.nih.gov>
|
||||
Date: Tue, 23 Oct 2018 11:05:20 -0400
|
||||
Subject: [PATCH] dblib: Address compiler warning
|
||||
|
||||
Remove unused constant.
|
||||
|
||||
Co-Authored-By: Pavel Ivanov <ivanovp@ncbi.nlm.nih.gov>
|
||||
---
|
||||
src/dblib/dblib.c | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/src/dblib/dblib.c b/src/dblib/dblib.c
|
||||
index 9b533487..00aba09f 100644
|
||||
--- a/src/dblib/dblib.c
|
||||
+++ b/src/dblib/dblib.c
|
||||
@@ -423,7 +423,6 @@ static const DBREAL null_REAL = 0;
|
||||
|
||||
static const DBCHAR null_CHAR = '\0';
|
||||
static const DBVARYCHAR null_VARYCHAR = { 0, {0} };
|
||||
-static const DBBINARY null_BINARY = 0;
|
||||
|
||||
static const DBDATETIME null_DATETIME = { 0, 0 };
|
||||
static const DBDATETIME4 null_SMALLDATETIME = { 0, 0 };
|
||||
--
|
||||
2.27.0
|
||||
|
||||
BIN
freetds-1.00.38.tar.bz2
Normal file
BIN
freetds-1.00.38.tar.bz2
Normal file
Binary file not shown.
15
freetds-tds_sysdep_public.h
Normal file
15
freetds-tds_sysdep_public.h
Normal file
@ -0,0 +1,15 @@
|
||||
/*
|
||||
* To avoid multiarch conflicts, we differentiate the 32/64 bit length
|
||||
* specific header names. This file is a wrapper to include the proper
|
||||
* arch-specific header at compile time.
|
||||
*/
|
||||
|
||||
#include <bits/wordsize.h>
|
||||
|
||||
#if __WORDSIZE == 32
|
||||
#include <tds_sysdep_public_32.h>
|
||||
#elif __WORDSIZE == 64
|
||||
#include <tds_sysdep_public_64.h>
|
||||
#else
|
||||
#error "Unknown word size"
|
||||
#endif
|
||||
139
freetds.spec
Normal file
139
freetds.spec
Normal file
@ -0,0 +1,139 @@
|
||||
Name: freetds
|
||||
Summary: Implementation of the TDS (Tabular DataStream) protocol
|
||||
Version: 1.00.38
|
||||
Release: 11
|
||||
License: LGPLv2+ and GPLv2+
|
||||
URL: http://www.freetds.org/
|
||||
|
||||
Source0: ftp://ftp.freetds.org/pub/freetds/stable/freetds-%{version}.tar.bz2
|
||||
Source1: freetds-tds_sysdep_public.h
|
||||
Patch0: CVE-2019-13508.patch
|
||||
Patch1: ctlib-Fix-cs_will_convert.patch
|
||||
Patch2: Fix-some-collation-encoding-detection.patch
|
||||
Patch3: dblib-Address-compiler-warning.patch
|
||||
|
||||
BuildRequires: unixODBC-devel readline-devel gnutls-devel krb5-devel
|
||||
BuildRequires: libgcrypt-devel libtool doxygen docbook-style-dsssl
|
||||
|
||||
Provides: %{name}-libs = %{version}-%{release}
|
||||
Obsoletes: %{name}-libs < %{version}-%{release}
|
||||
|
||||
%description
|
||||
FreeTDS is an open source implementation of the TDS (Tabular
|
||||
Data Stream) protocol used by these databases for their own clients.
|
||||
It supports many different flavors of the protocol and three APIs
|
||||
to access it. FreeTDS includes call level interfaces for DB-Lib,
|
||||
CT-Lib, and ODBC.
|
||||
|
||||
|
||||
%package devel
|
||||
Summary: Header files and development libraries for %{name}
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
|
||||
%description devel
|
||||
This package contains the header files and development libraries
|
||||
for %{name}. If you like to develop programs using %{name}, you will need
|
||||
to install %{name}-devel.
|
||||
|
||||
|
||||
%package help
|
||||
Summary: Help and development documentation for %{name}
|
||||
BuildArch: noarch
|
||||
Provides: freetds-doc
|
||||
Obsoletes: freetds-doc < %{version}-%{release}
|
||||
|
||||
%description help
|
||||
This package contains the help and development documentation for %{name}.
|
||||
If you like to grasp it and develop programs using %{name}, you will need
|
||||
to install %{name}-help.
|
||||
|
||||
%prep
|
||||
%autosetup -p1
|
||||
|
||||
sed -i '1 s,#!.*/perl,#!%{__perl},' samples/*.pl
|
||||
|
||||
chmod 644 samples/*.sh
|
||||
|
||||
%build
|
||||
|
||||
[ -f configure ] || NOCONFIGURE=yes ./autogen.sh
|
||||
|
||||
%configure \
|
||||
--disable-dependency-tracking --disable-rpath --disable-static \
|
||||
--with-tdsver="auto" --with-unixodbc="%{_prefix}" --enable-msdblib \
|
||||
--enable-sybase-compat --with-gnutls --enable-krb5
|
||||
|
||||
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|' libtool
|
||||
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_RIE|' libtool
|
||||
|
||||
%make_build DOCBOOK_DSL="`rpm -ql docbook-style-dsssl | fgrep html/docbook.dsl`"
|
||||
|
||||
|
||||
%install
|
||||
|
||||
%make_install
|
||||
|
||||
%delete_la
|
||||
chmod -x $RPM_BUILD_ROOT%{_sysconfdir}/*
|
||||
|
||||
mv -f $RPM_BUILD_ROOT%{_includedir}/tds_sysdep_public.h $RPM_BUILD_ROOT%{_includedir}/tds_sysdep_public_64.h
|
||||
install -p -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_includedir}/tds_sysdep_public.h
|
||||
|
||||
rm -f samples/{Makefile*,*.in,README}
|
||||
|
||||
mv -f samples/unixodbc.freetds.driver.template samples/unixodbc.freetds.driver.template-64
|
||||
|
||||
install -d samples-odbc
|
||||
mv -f samples/*odbc* samples-odbc
|
||||
|
||||
mv -f $RPM_BUILD_ROOT%{_docdir}/%{name} docdir
|
||||
find docdir -type f -exec chmod -x {} \;
|
||||
|
||||
%post
|
||||
/sbin/ldconfig
|
||||
|
||||
%postun
|
||||
/sbin/ldconfig
|
||||
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
|
||||
%files
|
||||
%{_bindir}/*
|
||||
%doc AUTHORS COPYING README COPYING.LIB samples-odbc
|
||||
%doc docdir/userguide docdir/images
|
||||
%{_libdir}/*.so.*
|
||||
%{_libdir}/libtdsodbc.so
|
||||
%config(noreplace) %{_sysconfdir}/*.conf
|
||||
|
||||
|
||||
%files devel
|
||||
%doc samples
|
||||
%{_libdir}/*.so
|
||||
%exclude %{_libdir}/libtdsodbc.so
|
||||
%{_includedir}/*
|
||||
|
||||
|
||||
%files help
|
||||
%{_mandir}/man1/*
|
||||
%{_mandir}/man5/*
|
||||
%doc docdir/reference BUGS TODO doc/*.html NEWS
|
||||
|
||||
|
||||
%changelog
|
||||
* Wed Dec 27 2023 fandehui <fandehui@xfusion.com> - 1.00.38-11
|
||||
- dblib: Address compiler warning
|
||||
|
||||
* Tue Nov 14 2023 fandehui <fandehui@xfusion.com> - 1.00.38-10
|
||||
- Fix some collation encoding detection
|
||||
|
||||
* Thu Nov 9 2023 fandehui <fandehui@xfusion.com> - 1.00.38-9
|
||||
- ctlib: Fix cs_will_convert
|
||||
|
||||
* Wed Feb 09 2022 wangkai <wangkai385@huawei.com> - 1.00.38-8
|
||||
- Fix CVE-2019-13508
|
||||
|
||||
* Thu Nov 28 2019 Wanjiankang <wanjiankang@huawei.com> - 1.00.38-7
|
||||
- Initial package.
|
||||
Loading…
x
Reference in New Issue
Block a user