Compare commits

...

No commits in common. 'c8' and 'i10fe' have entirely different histories.
c8 ... i10fe

2
.gitignore vendored

@ -1 +1 @@
SOURCES/recode-3.6.tar.gz SOURCES/recode-3.7.14.tar.gz

@ -1 +1 @@
2de90cd2ba553bc07d75a29913ea4424dd9e616b SOURCES/recode-3.6.tar.gz 43a291ddc3baeb3679b3803efa6e1c0b67e2bd53 SOURCES/recode-3.7.14.tar.gz

@ -0,0 +1,31 @@
From 80516f601ce5f1cee44848615dffe4252f2d205f Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Fri, 17 Feb 2023 12:52:19 +0000
Subject: [PATCH] src/task.c: only close input stream when we opened it (fix
#48)
Thanks to Remi Collet for the bug report and fix.
---
src/task.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/task.c b/src/task.c
index 2977a03..e302858 100644
--- a/src/task.c
+++ b/src/task.c
@@ -353,9 +353,10 @@ recode_perform_task (RECODE_TASK task)
SUBTASK_RETURN (subtask);
}
- /* Close the input file. */
+ /* Close the input file when we opened it. */
- if (subtask->input.file)
+ if (subtask->input.file && subtask->input.name &&
+ subtask->input.name[0])
fclose (subtask->input.file);
}
#endif
--
2.39.1

@ -1,11 +0,0 @@
--- recode-3.6/lib/gettext.c.orig 2005-03-07 12:18:30.000000000 +0100
+++ recode-3.6/lib/gettext.c 2005-03-07 12:23:14.000000000 +0100
@@ -1668,8 +1668,6 @@
# if !defined HAVE_GETCWD
char *getwd ();
# define getcwd(buf, max) getwd (buf)
-# else
-char *getcwd ();
# endif
# ifndef HAVE_STPCPY
static char *stpcpy PARAMS ((char *dest, const char *src));

@ -0,0 +1,15 @@
diff -ur a/lib/hash.h b/lib/hash.h
--- a/lib/hash.h 2023-01-04 23:06:45.000000000 +0100
+++ b/lib/hash.h 2023-01-17 13:04:05.200398680 +0100
@@ -24,6 +24,11 @@
#ifndef HASH_H_
# define HASH_H_
+#define hash_lookup recode_hash_lookup
+#define hash_delete recode_hash_delete
+#define hash_free recode_hash_free
+#define hash_insert recode_hash_insert
+
# include <stdio.h>
# ifdef __cplusplus

@ -1,22 +0,0 @@
--- recode-3.6.orig/configure.in 2001-01-03 16:50:54.000000000 +0100
+++ recode-3.6/configure.in 2012-07-23 14:15:28.000000000 +0200
@@ -15,7 +15,7 @@
AM_PROG_LIBTOOL
AC_ISC_POSIX
-AM_C_PROTOTYPES
+dnl AM_C_PROTOTYPES
AC_C_CONST
AC_C_INLINE
ad_AC_PROG_FLEX
--- recode-3.6.orig/src/Makefile.am 2000-12-06 17:36:12.000000000 +0100
+++ recode-3.6/src/Makefile.am 2012-07-23 14:47:07.000000000 +0200
@@ -17,7 +17,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
-AUTOMAKE_OPTIONS = gnits ansi2knr
+AUTOMAKE_OPTIONS = gnits
bin_PROGRAMS = recode
lib_LTLIBRARIES = librecode.la
man_MANS = recode.1

@ -1,11 +0,0 @@
--- src/recodext.h.orig 2008-01-16 13:15:39.000000000 +0100
+++ src/recodext.h 2008-01-16 13:16:47.000000000 +0100
@@ -218,7 +218,7 @@
enum recode_symbol_type type : 3;
/* Non zero if this one should be ignored. */
- bool ignore : 2;
+ bool ignore : 1;
};
struct recode_surface_list

@ -1,16 +0,0 @@
--- recode-3.6-orig/m4/flex.m4 2000-06-28 16:39:06.000000000 +0200
+++ recode-3.6/m4/flex.m4 2010-07-07 12:23:49.000000000 +0200
@@ -8,11 +8,8 @@
dnl Look for flex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT
AC_DEFUN(ad_AC_PROG_FLEX,
[AC_CHECK_PROGS(LEX, flex, missing)
-if test "$LEX" = missing; then
+AS_IF([test "$LEX" = missing], [
LEX="\$(top_srcdir)/$ac_aux_dir/missing flex"
LEX_OUTPUT_ROOT=lex.yy
AC_SUBST(LEX_OUTPUT_ROOT)dnl
-else
- AC_PROG_LEX
- AC_DECL_YYTEXT
-fi])
+])])

@ -1,12 +0,0 @@
diff -up recode-3.6/src/names.c.printf recode-3.6/src/names.c
--- recode-3.6/src/names.c.printf 2000-12-06 20:41:29.000000000 +0100
+++ recode-3.6/src/names.c 2013-12-18 12:48:42.578052395 +0100
@@ -892,7 +892,7 @@ list_concise_charset (RECODE_OUTER outer
if (ucs2 >= 0)
printf (format, code);
else if (mnemonic || counter2 != 112)
- printf (blanks);
+ printf ("%s", blanks);
if (mnemonic)
printf (counter2 == 112 ? " %s\n" : " %-3s", mnemonic);

@ -1,51 +0,0 @@
diff -u -r recode-3.6.orig/src/common.h recode-3.6/src/common.h
--- recode-3.6.orig/src/common.h 2000-06-28 20:40:15.000000000 +0200
+++ recode-3.6/src/common.h 2017-10-03 13:52:09.904644383 +0200
@@ -56,13 +56,14 @@
# define RETSIGTYPE void
#endif
-#if DIFF_HASH
-# ifdef HAVE_LIMITS_H
-# include <limits.h>
-# endif
-# ifndef CHAR_BIT
-# define CHAR_BIT 8
-# endif
+#ifdef HAVE_LIMITS_H
+# include <limits.h>
+#endif
+#ifndef CHAR_BIT
+# define CHAR_BIT 8
+#endif
+#ifndef PATH_MAX
+# define PATH_MAX 4096
#endif
/* Some systems do not define EXIT_*, even with STDC_HEADERS. */
diff -u -r recode-3.6.orig/src/main.c recode-3.6/src/main.c
--- recode-3.6.orig/src/main.c 2000-12-06 20:44:59.000000000 +0100
+++ recode-3.6/src/main.c 2017-10-03 14:32:51.274017940 +0200
@@ -847,7 +847,7 @@
for (; optind < argc; optind++)
{
const char *input_name;
- char output_name[200]; /* FIXME: dangerous limit */
+ char output_name[PATH_MAX];
FILE *file;
struct stat file_stat;
struct utimbuf file_utime;
@@ -871,7 +871,12 @@
/* FIXME: Scott Schwartz <schwartz@bio.cse.psu.edu> writes:
"There's no reason to think that that name is unique." */
-
+ // To avoid overflows, the size of the array pointed by destination (output_name)
+ // shall be long enough to contain the same C string as source
+ // (including the terminating null character).
+ if (strlen(input_name) >= PATH_MAX) {
+ error (EXIT_FAILURE, 0, "input_name reach the PATH_MAX limit");
+ }
strcpy (output_name, input_name);
#if DOSWIN_OR_OS2
for (cursor = output_name + strlen (output_name);

@ -1,68 +0,0 @@
--- recode-3.6.orig/src/libiconv.c
+++ recode-3.6/src/libiconv.c
@@ -1,5 +1,5 @@
/* Conversion of files between different charsets and surfaces.
- Copyright © 1999, 2000 Free Software Foundation, Inc.
+ Copyright © 1999, 2000, 2001 Free Software Foundation, Inc.
Contributed by François Pinard <pinard@iro.umontreal.ca>, 1999,
and Bruno Haible <haible@clisp.cons.org>, 2000.
@@ -195,12 +195,17 @@
memcpy() doesn't do here, because the regions might overlap.
memmove() isn't worth it, because we rarely have to move more
than 12 bytes. */
- if (input > input_buffer && input_left > 0)
+ cursor = input_buffer;
+ if (input_left > 0)
{
- cursor = input_buffer;
- do
- *cursor++ = *input++;
- while (--input_left > 0);
+ if (input > input_buffer)
+ {
+ do
+ *cursor++ = *input++;
+ while (--input_left > 0);
+ }
+ else
+ cursor += input_left;
}
}
--- recode-3.6.orig/src/request.c
+++ recode-3.6/src/request.c
@@ -1073,7 +1073,7 @@
if (task->output.cursor + 4 >= task->output.limit)
{
RECODE_OUTER outer = task->request->outer;
- size_t old_size = task->output.limit - task->output.buffer;
+ size_t old_size = task->output.cursor - task->output.buffer;
size_t new_size = task->output.cursor + 4 - task->output.buffer;
/* FIXME: Rethink about how the error should be reported. */
--- recode-3.6.orig/src/task.c
+++ recode-3.6/src/task.c
@@ -1198,6 +1198,8 @@
else
success = transform_mere_copy (subtask);
+ task->output = subtask->output;
+
if (subtask->input.name && *subtask->input.name)
fclose (subtask->input.file);
if (subtask->output.name && *subtask->output.name)
--- recode-3.6.orig/src/hash.h
+++ recode-3.6/src/hash.h
@@ -21,6 +21,11 @@
/* Make sure USE_OBSTACK is defined to 1 if you want the allocator to use
obstacks instead of malloc, and recompile `hash.c' with same setting. */
+#define hash_lookup recode_hash_lookup
+#define hash_delete recode_hash_delete
+#define hash_free recode_hash_free
+#define hash_insert recode_hash_insert
+
#ifndef PARAMS
# if PROTOTYPES || __STDC__
# define PARAMS(Args) Args

@ -1,103 +1,240 @@
Summary: Conversion between character sets and surfaces Name: recode
Name: recode Version: 3.7.14
Version: 3.6 Release: 6%{?dist}
Release: 47%{?dist} Summary: Conversion between character sets and surfaces
License: GPLv2+ # COPYING: GPLv3 text
Group: Applications/File # COPYING-LIB: LGPLv3 text
Url: http://recode.progiciels-bpi.ca/ # doc/recode.info: OFSFDL
Source: http://recode.progiciels-bpi.ca/archives/recode-%{version}.tar.gz # doc/recode.texi: OFSFDL
Patch0: recode.patch # lib/error.h: GPLv3+
Patch1: recode-3.6-getcwd.patch # lib/strerror-override.c: GPLv3+
Patch2: recode-bool-bitfield.patch # lib/vasnprintf.c: GPLv3+
Patch3: recode-flex-m4.patch # src/ansellat1.l: BSD
Patch4: recode-automake.patch # src/lat1asci.c: GPLv3+
Patch5: recode-format-security.patch # src/merged.c: BSD
Patch6: recode-longfilename.patch # src/recode.h: LGPLv3+
# src/ucs.c: LGPLv3+
Requires(post): /sbin/install-info ## Not in any binary package
Requires(post): /sbin/ldconfig # aclocal.m4: FSFULLR
Requires(preun): /sbin/install-info # build-aux/bootstrap.in: MIT or GPLv3+ (bundled gnulib-modules/bootstrap)
Requires(postun): /sbin/ldconfig # build-aux/compile: GPLv2+ with exceptions
# build-aux/config.guess: GPLv3+ with exceptions
BuildRequires: libtool # build-aux/config.rpath: FSFULLR
BuildRequires: texinfo # build-aux/config.sub: GPLv3+ with exceptions
# build-aux/depcomp: GPLv2+ with exceptions
# build-aux/extract-trace: MIT or GPLv3+ (bundled gnulib-modules/bootstrap)
# build-aux/funclib.sh: MIT or GPLv3+ (bundled gnulib-modules/bootstrap)
# build-aux/inline-source: MIT or GPLv3+ (bundled gnulib-modules/bootstrap)
# build-aux/install-sh: MIT
# build-aux/ltmain.sh: GPLv2+ with exceptions and GPLv3+ with exceptions
# and GPLv3+
# build-aux/mdate-sh: GPLv2+ with exceptions
# build-aux/missing: GPLv2+ with exceptions
# build-aux/options-parser: MIT or GPLv3+ (bundled gnulib-modules/bootstrap)
# build-aux/texinfo.tex: GPLv3+ with exceptions
# config.rpath: FSFULLR
# configure: FSFUL and GPLv2+ with exceptions
# doc/Makefile.am: GPLv3+
# doc/Makefile.in: FSFULLR and GPLv3+
# doc/texinfo.tex: GPLv2+ with exceptions
# INSTALL: FSFAP
# Makefile.am: GPLv3+
# m4/gettext.m4: FSFULLR
# m4/gnulib-cache.m4: GPLv3+ with exceptions
# m4/libtool.m4: GPLv2+ with exceptions and FSFUL
# m4/mbstate_t.m4: FSFULLR
# m4/minmax.m4: FSFULLR
# m4/ssize_t.m4: FSFULLR
# m4/sys_stat_h.m4: FSFULLR
# tables.py: GPLv3+
# tests/Makefile.am: GPLv3+
# tests/Makefile.in: FSFULLR and GPLv3+
# tests/Recode.pyx: GPLv3+
License: GPL-3.0-or-later AND LGPL-3.0-or-later AND BSD-2-Clause AND LicenseRef-OFSFDL
URL: https://github.com/rrthomas/recode
Source: %{url}/releases/download/v%{version}/recode-%{version}.tar.gz
Patch: recode-3.7.13-Rename-coliding-hash-functions.patch
# https://github.com/rrthomas/recode/issues/48
Patch: 0001-src-task.c-only-close-input-stream-when-we-opened-it.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: coreutils
BuildRequires: gcc
BuildRequires: gettext-devel
# help2man is executed from ./src/Makefile if main.c or configure.ac is newer
# than recode.1.
BuildRequires: make
BuildRequires: libtool
BuildRequires: texinfo
# Tests:
BuildRequires: python3-Cython
BuildRequires: python3-devel >= 3.7.5
BuildRequires: python3-setuptools
%description %description
The `recode' converts files between character sets and usages. The recode tool and library convert files between character sets and surfaces.
It recognizes or produces nearly 150 different character sets It recognizes or produces over 200 different character sets (or about 300 if
and is able to transliterate files between almost any pair. When exact combined with an iconv library) and transliterates files between almost any
transliteration are not possible, it may get rid of the offending pair. When exact transliteration is not possible, it gets rid of the offending
characters or fall back on approximations. Most RFC 1345 character sets character or falls back on an approximations.
are supported.
%package devel %package devel
Summary: Header files for development using recode Summary: Header files for development using recode library
Group: Development/Libraries # Header files are LGPLv3+
Requires: %{name}%{?_isa} = %{version}-%{release} License: LGPL-3.0-or-later
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel %description devel
The `recode' library converts files between character sets and usages. This package provides the header files for a recode library.
The library recognizes or produces nearly 150 different character sets
and is able to transliterate files between almost any pair. When exact
transliteration are not possible, it may get rid of the offending
characters or fall back on approximations. Most RFC 1345 character sets
are supported.
%prep %prep
%setup -q %autosetup -p1 -n %{name}-%{version}
%patch0 -p1 autoreconf -fi
%patch1 -p1 -b .getcwd
%patch2 -p0
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
rm m4/libtool.m4
rm acinclude.m4
%build %build
autoreconf -fiv export PYTHON=%{__python3}
%configure --disable-static %configure \
make %{?_smp_mflags} --without-dmalloc \
--disable-gcc-warnings \
--enable-largefile \
--enable-nls \
--disable-rpath \
--enable-shared \
--disable-static
%{make_build}
%check %check
make check make check
%install %install
%makeinstall %{make_install}
%find_lang %{name} %find_lang %{name}
# remove unpackaged file from the buildroot # remove unpackaged file from the buildroot
rm -f $RPM_BUILD_ROOT%{_infodir}/dir rm -r $RPM_BUILD_ROOT%{_infodir}/dir
# remove libtool archives # remove libtool archives
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la rm $RPM_BUILD_ROOT%{_libdir}/*.la
%post
/sbin/ldconfig
/sbin/install-info %{_infodir}/recode.info.gz %{_infodir}/dir --entry="* recode: (recode). Conversion between character sets and surfaces." || :
%preun
if [ $1 = 0 ]; then
/sbin/install-info --delete %{_infodir}/recode.info.gz %{_infodir}/dir --entry="* recode: (recode). Conversion between character sets and surfaces." || :
fi
%postun -p /sbin/ldconfig
%files -f %{name}.lang %files -f %{name}.lang
%doc AUTHORS COPYING* ChangeLog NEWS README THANKS TODO %license COPYING COPYING-LIB
# Changelog is not helpful
%doc AUTHORS NEWS README THANKS TODO
%{_mandir}/*/* %{_mandir}/*/*
%{_infodir}/recode.info* %{_infodir}/recode.info*
%{_bindir}/* %{_bindir}/*
%{_libdir}/*.so.0* %{_libdir}/librecode.so.3
%{_libdir}/librecode.so.3.*
%files devel %files devel
%{_libdir}/*.so %{_libdir}/*.so
%{_includedir}/* %{_includedir}/*
%changelog %changelog
* Thu Dec 26 2024 Dmitriy Samoylik <samoylikdv@msvsphere-os.ru> - 3.7.14-6
- Rebuilt for MSVSphere 10
* Fri Jul 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 3.7.14-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
* Wed Jul 17 2024 Miroslav Suchý <msuchy@redhat.com> - 3.7.14-5
- convert license to SPDX
* Fri Jan 26 2024 Fedora Release Engineering <releng@fedoraproject.org> - 3.7.14-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Mon Jan 22 2024 Fedora Release Engineering <releng@fedoraproject.org> - 3.7.14-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 3.7.14-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Wed Feb 22 2023 Ondrej Pohorelsky <opohorel@redhat.com> - 3.7.14-1
- 3.7.14 bump
- Adds upstream patch to prevent double free
- Require python3-setuptools unconditionaly
- Resolves: rhbz#2170818, rhbz#2166136
* Tue Jan 17 2023 Ondrej Pohorelsky <opohorel@redhat.com> - 3.7.13-1
- 3.7.13 bump
- Resolves: rhbz#2158811
* Thu Oct 27 2022 Ondrej Pohorelsky <opohorel@redhat.com> - 3.7.12-3
- Adds BuildRequire for Python 3.12
* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 3.7.12-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Mon Feb 21 2022 Ondrej Pohorelsky <opohorel@redhat.com> - 3.7.12-1
- 3.7.12 bump
- Resolves: rhbz#2055897
* Tue Feb 08 2022 Ondrej Pohorelsky <opohorel@redhat.com> - 3.7.11-1
- 3.7.11 bump
- Resolves: rhbz#2043834
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 3.7.9-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.7.9-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Tue Jun 08 2021 Ondrej Pohorelsky <opohorel@redhat.com> - 3.7.9-1
- 3.7.9 bump
- Resolves: rhbz#1967383
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.7.8-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Thu Nov 12 2020 Ondrej Pohorelsky <opohorel@redhat.com> - 3.7.8-1
- 3.7.8 bump
* Thu Jul 30 2020 Petr Pisar <ppisar@redhat.com> - 3.7.7-1
- 3.7.7 bump
* Wed Jul 29 2020 Petr Pisar <ppisar@redhat.com> - 3.7.6-4
- Correct a description
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.7.6-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.7.6-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Fri Sep 13 2019 Petr Pisar <ppisar@redhat.com> - 3.7.6-1
- 3.7.6
* Thu Sep 12 2019 Petr Pisar <ppisar@redhat.com> - 3.7.5-1
- 3.7.5 bump
- Fix a possible buffer overflow in transform_utf16_java()
- Fix a type mismatch in tests
* Mon Sep 02 2019 Petr Pisar <ppisar@redhat.com> - 3.7.4-1
- 3.7.4 bump
* Mon Sep 02 2019 Petr Pisar <ppisar@redhat.com> - 3.7.3-1
- 3.7.3 bump
* Tue Aug 20 2019 Petr Pisar <ppisar@redhat.com> - 3.7.2-1
- 3.7.2 bump
- Change a soname because recode-3.7 changed an ABI
(https://github.com/rrthomas/recode/issues/22)
* Fri Aug 16 2019 Petr Pisar <ppisar@redhat.com> - 3.7.1-1
- 3.7.1 bump (bug #1379055)
- License changed to GPLv3+ and LGPLv3+ and BSD and OFSFDL
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.6-50
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.6-49
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.6-48
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Fri Feb 09 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 3.6-47 * Fri Feb 09 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 3.6-47
- Escape macros in %%changelog - Escape macros in %%changelog

Loading…
Cancel
Save