diff --git a/lua-5.3.4-tests.tar.gz b/lua-5.3.4-tests.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..ffb79b6c84f740b14f35de9ae07ccc47cf7ea140 Binary files /dev/null and b/lua-5.3.4-tests.tar.gz differ diff --git a/lua-5.3.5-luac-shared-link-fix.patch b/lua-5.3.5-luac-shared-link-fix.patch deleted file mode 100644 index e50871818b7c1547552d76cf2cf6be688165782e..0000000000000000000000000000000000000000 --- a/lua-5.3.5-luac-shared-link-fix.patch +++ /dev/null @@ -1,54 +0,0 @@ -diff -up lua-5.3.5/src/lopcodes.c.luac-shared lua-5.3.5/src/lopcodes.c ---- lua-5.3.5/src/lopcodes.c.luac-shared 2020-07-28 16:21:44.219960426 -0400 -+++ lua-5.3.5/src/lopcodes.c 2020-07-28 16:21:44.219960426 -0400 -@@ -17,7 +17,7 @@ - - /* ORDER OP */ - --LUAI_DDEF const char *const luaP_opnames[NUM_OPCODES+1] = { -+LUA_API const char *const luaP_opnames[NUM_OPCODES+1] = { - "MOVE", - "LOADK", - "LOADKX", -@@ -71,7 +71,7 @@ LUAI_DDEF const char *const luaP_opnames - - #define opmode(t,a,b,c,m) (((t)<<7) | ((a)<<6) | ((b)<<4) | ((c)<<2) | (m)) - --LUAI_DDEF const lu_byte luaP_opmodes[NUM_OPCODES] = { -+LUA_API const lu_byte luaP_opmodes[NUM_OPCODES] = { - /* T A B C mode opcode */ - opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_MOVE */ - ,opmode(0, 1, OpArgK, OpArgN, iABx) /* OP_LOADK */ -diff -up lua-5.3.5/src/lopcodes.h.luac-shared lua-5.3.5/src/lopcodes.h ---- lua-5.3.5/src/lopcodes.h.luac-shared 2020-07-28 16:21:44.219960426 -0400 -+++ lua-5.3.5/src/lopcodes.h 2020-07-28 16:21:44.219960426 -0400 -@@ -278,7 +278,7 @@ enum OpArgMask { - OpArgK /* argument is a constant or register/constant */ - }; - --LUAI_DDEC const lu_byte luaP_opmodes[NUM_OPCODES]; -+LUA_API const lu_byte luaP_opmodes[NUM_OPCODES]; - - #define getOpMode(m) (cast(enum OpMode, luaP_opmodes[m] & 3)) - #define getBMode(m) (cast(enum OpArgMask, (luaP_opmodes[m] >> 4) & 3)) -@@ -287,7 +287,7 @@ LUAI_DDEC const lu_byte luaP_opmodes[NUM - #define testTMode(m) (luaP_opmodes[m] & (1 << 7)) - - --LUAI_DDEC const char *const luaP_opnames[NUM_OPCODES+1]; /* opcode names */ -+LUA_API const char *const luaP_opnames[NUM_OPCODES+1]; /* opcode names */ - - - /* number of list items to accumulate before a SETLIST instruction */ -diff -up lua-5.3.5/src/lundump.h.luac-shared lua-5.3.5/src/lundump.h ---- lua-5.3.5/src/lundump.h.luac-shared 2020-07-28 16:21:44.219960426 -0400 -+++ lua-5.3.5/src/lundump.h 2020-07-28 16:21:44.219960426 -0400 -@@ -26,7 +26,7 @@ - LUAI_FUNC LClosure* luaU_undump (lua_State* L, ZIO* Z, const char* name); - - /* dump one chunk; from ldump.c */ --LUAI_FUNC int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, -+LUA_API int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, - void* data, int strip); - - #endif diff --git a/lua-5.4.0-beta-autotoolize.patch b/lua-5.4.0-beta-autotoolize.patch deleted file mode 100644 index 74e7d1689f7fbd52f5fd5f56c58817505045ef49..0000000000000000000000000000000000000000 --- a/lua-5.4.0-beta-autotoolize.patch +++ /dev/null @@ -1,192 +0,0 @@ -diff -up lua-5.4.0-beta/configure.ac.autoxxx lua-5.4.0-beta/configure.ac ---- lua-5.4.0-beta/configure.ac.autoxxx 2020-07-28 16:10:13.316916421 -0400 -+++ lua-5.4.0-beta/configure.ac 2020-07-28 16:10:13.316916421 -0400 -@@ -0,0 +1,69 @@ -+AC_PREREQ(2.59) -+AC_INIT([lua], [5.4.0], [https://bugzilla.redhat.com/], [lua-at], [http://www.lua.org]) -+AC_SUBST([MAJOR_VERSION], [5.4]) -+ -+AC_CONFIG_HEADERS([config.h]) -+AC_CONFIG_SRCDIR([src/lapi.c]) -+ -+AM_INIT_AUTOMAKE([1.9 foreign]) -+ -+AC_PROG_CC -+AC_PROG_LIBTOOL -+ -+AC_ARG_WITH( -+ [readline], -+ [AC_HELP_STRING([--with-readline], [Use readline for interpreter input [default=yes]])], -+ [use_readline=$withval], -+ [use_readline=yes] -+) -+ -+LUA_LIBS="-lm" -+ -+# Check for readline -+READLINE_DEFS="#undef LUA_USE_READLINE" -+if test "x$use_readline" == "xyes"; then -+ AC_CHECK_LIB([readline], [readline], [:], [use_readline=no], [-lncurses]) -+ AC_CHECK_HEADERS([readline/readline.h readline/history.h], [], [use_readline=no]) -+ if test "x$use_readline" == "xno"; then -+ AC_MSG_WARN([readline headers could not be found, disabling readline support]) -+ else -+ READLINE_DEFS="#define LUA_USE_READLINE" -+ READLINE_LIBS="-lreadline -lncurses" -+ fi -+fi -+AC_SUBST(READLINE_DEFS) -+AC_SUBST(READLINE_LIBS) -+ -+case "$host" in -+ *-mingw*) use_os=win32 ;; -+ *-darwin*) use_os=macosx ;; -+ *) use_os=posix ;; -+esac -+ -+POSIX_DEFS="#undef LUA_USE_POSIX" -+LUA_DL_DEFS="#undef LUA_USE_DLOPEN" -+LUA_BUILD_AS_DLL_DEFS="#undef LUA_BUILD_AS_DLL" -+ -+if test "x$use_os" == "xwin32"; then -+ LUA_BUILD_AS_DLL_DEFS="#define LUA_BUILD_AS_DLL" -+elif test "x$use_os" == "xmacosx"; then -+ POSIX_DEFS="#define LUA_USE_POSIX" -+ LUA_DL_DEFS="#define LUA_DL_DYLD" -+elif test "x$use_os" == "xposix"; then -+ POSIX_DEFS="#define LUA_USE_POSIX" -+ LUA_DL_DEFS="#define LUA_DL_DLOPEN" -+ LUA_LIBS="$LUA_LIBS -ldl" -+fi -+AC_SUBST(POSIX_DEFS) -+AC_SUBST(LUA_DL_DEFS) -+AC_SUBST(LUA_BUILD_AS_DLL_DEFS) -+ -+AC_SUBST(LUA_LIBS) -+ -+AC_CONFIG_FILES([Makefile -+ src/Makefile -+ src/lua.pc -+ src/luaconf.h.template -+ doc/Makefile -+]) -+AC_OUTPUT -diff -up lua-5.4.0-beta/doc/Makefile.am.autoxxx lua-5.4.0-beta/doc/Makefile.am ---- lua-5.4.0-beta/doc/Makefile.am.autoxxx 2020-07-28 16:10:13.316916421 -0400 -+++ lua-5.4.0-beta/doc/Makefile.am 2020-07-28 16:10:13.316916421 -0400 -@@ -0,0 +1,4 @@ -+man1_MANS = lua.1 luac.1 -+ -+EXTRA_DIST = \ -+ contents.html logo.gif lua.1 luac.1 lua.css manual.css manual.html osi-certified-72x60.png readme.html -diff -up lua-5.4.0-beta/Makefile.am.autoxxx lua-5.4.0-beta/Makefile.am ---- lua-5.4.0-beta/Makefile.am.autoxxx 2020-07-28 16:10:13.316916421 -0400 -+++ lua-5.4.0-beta/Makefile.am 2020-07-28 16:10:13.316916421 -0400 -@@ -0,0 +1,3 @@ -+SUBDIRS = src doc -+ -+EXTRA_DIST = README -diff -up lua-5.4.0-beta/src/.gitignore.autoxxx lua-5.4.0-beta/src/.gitignore ---- lua-5.4.0-beta/src/.gitignore.autoxxx 2020-07-28 16:10:13.316916421 -0400 -+++ lua-5.4.0-beta/src/.gitignore 2020-07-28 16:10:13.316916421 -0400 -@@ -0,0 +1,5 @@ -+lua -+lua.pc -+luac -+luaconf.h -+luaconf.h.template -diff -up lua-5.4.0-beta/src/luaconf.h.template.in.autoxxx lua-5.4.0-beta/src/luaconf.h.template.in ---- lua-5.4.0-beta/src/luaconf.h.template.in.autoxxx 2020-07-28 16:10:13.316916421 -0400 -+++ lua-5.4.0-beta/src/luaconf.h.template.in 2020-07-28 16:10:13.316916421 -0400 -@@ -11,6 +11,11 @@ - #include - #include - -+@POSIX_DEFS@ -+@LUA_DL_DEFS@ -+@LUA_BUILD_AS_DLL_DEFS@ -+@READLINE_DEFS@ -+ - - /* - ** =================================================================== -@@ -227,9 +232,9 @@ - - #else /* }{ */ - --#define LUA_ROOT "/usr/local/" --#define LUA_LDIR LUA_ROOT "share/lua/" LUA_VDIR "/" --#define LUA_CDIR LUA_ROOT "lib/lua/" LUA_VDIR "/" -+#define LUA_ROOT "@prefix@/" -+#define LUA_LDIR "@pkgdatadir@/lua/" LUA_VDIR "/" -+#define LUA_CDIR "@libdir@/lua/" LUA_VDIR "/" - - #if !defined(LUA_PATH_DEFAULT) - #define LUA_PATH_DEFAULT \ -diff -up lua-5.4.0-beta/src/lua.pc.in.autoxxx lua-5.4.0-beta/src/lua.pc.in ---- lua-5.4.0-beta/src/lua.pc.in.autoxxx 2020-07-28 16:10:13.316916421 -0400 -+++ lua-5.4.0-beta/src/lua.pc.in 2020-07-28 16:10:13.316916421 -0400 -@@ -0,0 +1,13 @@ -+V= @MAJOR_VERSION@ -+R= @VERSION@ -+prefix= @prefix@ -+exec_prefix=${prefix} -+libdir= @libdir@ -+includedir=${prefix}/include -+ -+Name: Lua -+Description: An Extensible Extension Language -+Version: ${R} -+Requires: -+Libs: -llua @LUA_LIBS@ -+Cflags: -I${includedir} -diff -up lua-5.4.0-beta/src/Makefile.am.autoxxx lua-5.4.0-beta/src/Makefile.am ---- lua-5.4.0-beta/src/Makefile.am.autoxxx 2020-07-28 16:10:13.316916421 -0400 -+++ lua-5.4.0-beta/src/Makefile.am 2020-07-28 16:10:13.316916421 -0400 -@@ -0,0 +1,46 @@ -+AM_CFLAGS = -Wall -+ -+include_HEADERS = lua.h lualib.h lauxlib.h lua.hpp -+ -+nodist_include_HEADERS = luaconf.h -+ -+lib_LTLIBRARIES = liblua.la -+liblua_la_LDFLAGS = -release @MAJOR_VERSION@ -+liblua_la_SOURCES = \ -+ lapi.c lauxlib.c lbaselib.c lcode.c lcorolib.c lctype.c ldblib.c \ -+ ldebug.c ldo.c ldump.c lfunc.c lgc.c linit.c liolib.c llex.c lmathlib.c lmem.c \ -+ loadlib.c lobject.c lopcodes.c loslib.c lparser.c lstate.c lstring.c lstrlib.c \ -+ ltable.c ltablib.c ltm.c lundump.c lutf8lib.c lvm.c lzio.c \ -+ lapi.h lcode.h lctype.h ldebug.h ldo.h lfunc.h lgc.h llex.h llimits.h \ -+ lmem.h lobject.h lopcodes.h lparser.h lstate.h lstring.h ltable.h ltm.h \ -+ lundump.h lvm.h lzio.h -+ -+pkgconfigdir = $(libdir)/pkgconfig -+pkgconfig_DATA = lua.pc -+ -+bin_PROGRAMS = lua luac -+ -+lua_SOURCES = lua.c -+lua_LDADD = liblua.la @LUA_LIBS@ @READLINE_LIBS@ -+lua_DEPENDENCIES = liblua.la -+ -+luac_SOURCES = luac.c -+# Statically link liblua against luac since luac uses symbols not exported in liblua -+luac_LDADD = .libs/liblua.a @LUA_LIBS@ -+luac_DEPENDENCIES = liblua.la -+ -+EXTRA_DIST = luaconf.h.template -+BUILT_SOURCES = luaconf.h -+CLEANFILES = luaconf.h luaconf.h.template -+ -+readline_defs = @READLINE_DEFS@ -+ -+edit = sed \ -+ -e 's,%prefix%,$(prefix),g' \ -+ -e 's,%lua_datadir%,$(datadir),g' \ -+ -e 's,%lua_libdir%,$(libdir),g' -+ -+luaconf.h : luaconf.h.template -+ rm -f $@ $@.tmp -+ $(edit) $< >$@.tmp -+ mv $@.tmp $@ diff --git a/lua-5.4.0-tests.tar.gz b/lua-5.4.0-tests.tar.gz deleted file mode 100644 index e6bff24f1ef09a5c44e2d0fc1042ac8a9328b247..0000000000000000000000000000000000000000 Binary files a/lua-5.4.0-tests.tar.gz and /dev/null differ diff --git a/lua-5.4.0.tar.gz b/lua-5.4.0.tar.gz deleted file mode 100644 index d99933c21733778c310ab0050b98b8c9eb45894c..0000000000000000000000000000000000000000 Binary files a/lua-5.4.0.tar.gz and /dev/null differ diff --git a/lua-CVE-2019-6706.patch b/lua-CVE-2019-6706.patch new file mode 100644 index 0000000000000000000000000000000000000000..cce9c733c702aeff57e6c4460ee417ac881cc5a4 --- /dev/null +++ b/lua-CVE-2019-6706.patch @@ -0,0 +1,22 @@ +--- a/src/lapi.c 2017-12-06 13:35:12.000000000 -0500 ++++ b/src/lapi_1.c 2019-06-24 07:48:06.289000000 -0400 +@@ -1286,14 +1286,14 @@ LUA_API void *lua_upvalueid (lua_State * + + LUA_API void lua_upvaluejoin (lua_State *L, int fidx1, int n1, + int fidx2, int n2) { +- LClosure *f1; +- UpVal **up1 = getupvalref(L, fidx1, n1, &f1); ++ UpVal **up1 = getupvalref(L, fidx1, n1, NULL); /* the last parameter not needed */ + UpVal **up2 = getupvalref(L, fidx2, n2, NULL); ++ if (*up1 == *up2) return; /* Already joined */ ++ (*up2)->refcount++; ++ if (upisopen(*up2)) (*up2)->u.open.touched = 1; ++ luaC_upvalbarrier(L, *up2); + luaC_upvdeccount(L, *up1); + *up1 = *up2; +- (*up1)->refcount++; +- if (upisopen(*up1)) (*up1)->u.open.touched = 1; +- luaC_upvalbarrier(L, *up1); + } + + diff --git a/lua.attr b/lua.attr deleted file mode 100644 index a4332662169a80176eec9c2532c2ed097c36f9bb..0000000000000000000000000000000000000000 --- a/lua.attr +++ /dev/null @@ -1,19 +0,0 @@ -%__lua_requires() %{lua: - -- Match buildroot paths of the form - -- /PATH/OF/BUILDROOT/usr/lib(64)/lua/MAJOR.MINOR/ and - -- /PATH/OF/BUILDROOT/usr/share/pythonMAJOR.MINOR/ - -- generating a line of the form: - -- lua(abi) = MAJOR.MINOR - local path = rpm.expand('%1') - local datadir = rpm.expand('%_datadir') - local libdir = rpm.expand('%_libdir') - for i, dir in ipairs({datadir, libdir}) do - if path:match(dir .. '/lua/%d+%.%d+/.*') then - local requires = path:gsub('.*' .. dir .. '/lua/(%d+%.%d+)/.*', 'lua(abi) = %1') - print(requires) - break - end - end -} - -%__lua_path ^(%{_datadir}|%{_libdir})/lua/[[:digit:]]+\\.[[:digit:]]+/.+ diff --git a/lua.spec b/lua.spec index 111481ef09bc5a0e962a565a61e6ab7d9f0f927f..ce52f0384cf6c7b6577d44c3185dc54c3bfe518b 100644 --- a/lua.spec +++ b/lua.spec @@ -1,12 +1,12 @@ -%global major_version 5.4 -# test version is still 5.4.0 -%global test_version 5.4.0 +%global major_version 5.3 +# test version is still 5.3.4 +%global test_version 5.3.4 # Place rpm-macros into proper location. %global macrosdir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d) Name: lua -Version: 5.4.0 -Release: 1 +Version: 5.3.5 +Release: 5 Summary: A powerful, efficient, lightweight, embeddable scripting language License: MIT URL: http://www.lua.org/ @@ -17,24 +17,26 @@ Source1: http://www.lua.org/tests/lua-%{test_version}-tests.tar.gz Source2: luaconf.h # copied from doc/readme.html on 2019-09-11 Source3: mit.txt -Source4: http://www.lua.org/ftp/lua-5.3.5.tar.gz # rpm-macro Source1000: macros.lua -Source1001: lua.attr -Patch0: lua-5.4.0-beta-autotoolize.patch +Patch0: lua-5.3.0-autotoolize.patch Patch1: lua-5.3.0-idsize.patch Patch2: lua-5.2.2-configure-linux.patch Patch3: lua-5.3.0-configure-compat-module.patch -Patch4: lua-5.3.0-autotoolize.patch -Patch5: lua-5.3.5-luac-shared-link-fix.patch + +#Patch for cves +Patch6000: lua-CVE-2019-6706.patch BuildRequires: automake autoconf libtool readline-devel ncurses-devel Obsoletes: %{name}-libs < %{version}-%{release} -Provides: lua(abi) = 5.3 -Provides: lua(abi) = %{major_version} +Provides: lua(abi) = %{major_version} Provides: %{name}-libs = %{version}-%{release} +# for temporary downgrade, to be removed +Provides: lua(abi) = 5.4 +Provides: liblua-5.4.so()(64bit) + %description Lua is a powerful, efficient, lightweight, embeddable scripting language. It supports procedural programming, object-oriented programming, @@ -53,7 +55,7 @@ This package contains development files for %{name}. %package_help %prep -%setup -q -a 4 -a 1 -n %{name}-%{version} +%setup -q -a 1 cp %{SOURCE3} . mv src/luaconf.h src/luaconf.h.template.in %patch0 -p1 -E -z .autoxxx @@ -64,15 +66,7 @@ mv src/luaconf.h src/luaconf.h.template.in sed -i 's|5.3.0|%{version}|g' configure.ac autoreconf -ifv -cd lua-5.3.5/ -mv src/luaconf.h src/luaconf.h.template.in -%patch4 -p1 -b .autoxxx -%patch1 -p1 -b .idsize -%patch2 -p1 -z .configure-linux -%patch3 -p1 -z .configure-compat-all -%patch5 -p1 -b .luac-shared-link-fix -autoreconf -i -cd .. +%patch6000 -p1 %build %configure --with-readline --with-compat-module @@ -85,16 +79,6 @@ sed -i 's|@pkgdatadir@|%{_datadir}|g' src/luaconf.h.template %make_build LIBS="-lm -ldl" # only /usr/bin/lua links with readline now #luac_LDADD="liblua.la -lm -ldl" -pushd lua-5.3.5 -%configure --with-readline --with-compat-module -sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool -sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool - -sed -i 's|@pkgdatadir@|%{_datadir}|g' src/luaconf.h.template - -make %{?_smp_mflags} LIBS="-lm -ldl" luac_LDADD="liblua.la -lm -ldl" -popd - %install %make_install rm $RPM_BUILD_ROOT%{_libdir}/*.la @@ -106,18 +90,8 @@ mkdir -p %{buildroot}/%{_datadir}/lua/%{major_version} mv %{buildroot}%{_includedir}/luaconf.h %{buildroot}%{_includedir}/luaconf-%{_arch}.h install -p -m 644 %{SOURCE2} %{buildroot}%{_includedir}/luaconf.h -pushd lua-5.3.5 -mkdir $RPM_BUILD_ROOT/installdir -make install DESTDIR=$RPM_BUILD_ROOT/installdir -cp -a $RPM_BUILD_ROOT/installdir/%{_libdir}/liblua-5.3.so $RPM_BUILD_ROOT%{_libdir}/ -mkdir -p $RPM_BUILD_ROOT%{_libdir}/lua/5.3 -mkdir -p $RPM_BUILD_ROOT%{_datadir}/lua/5.3 -rm -rf $RPM_BUILD_ROOT/installdir -popd - # Install rpm-macro install -Dpm 0644 %{SOURCE1000} $RPM_BUILD_ROOT/%{macrosdir}/macros.lua -install -Dpm 0644 %{SOURCE1001} $RPM_BUILD_ROOT/%{_fileattrsdir}/lua.attr %check cd ./lua-%{test_version}-tests/ @@ -149,20 +123,13 @@ LD_LIBRARY_PATH=$RPM_BUILD_ROOT/%{_libdir} $RPM_BUILD_ROOT/%{_bindir}/lua -e"_U= %{_libdir}/liblua-%{major_version}.so %{_libdir}/liblua.so -%dir %{_libdir}/lua/5.3 -%{_libdir}/liblua-5.3.so -%dir %{_datadir}/lua/5.3 - %files devel %defattr(-,root,root) %{_includedir}/l*.h %{_includedir}/l*.hpp %{_libdir}/pkgconfig/*.pc -%dir %{macrosdir} %{_libdir}/*.a %{macrosdir}/macros.lua -%dir %{_fileattrsdir} -%{_fileattrsdir}/lua.attr %files help %defattr(-,root,root) @@ -170,6 +137,9 @@ LD_LIBRARY_PATH=$RPM_BUILD_ROOT/%{_libdir} $RPM_BUILD_ROOT/%{_bindir}/lua -e"_U= %{_mandir}/man1/lua*.1* %changelog +* Sat Aug 8 2020 shenyangyang - 5.3.5-5 +- downgrade version to 5.3.5 + * Sat Aug 1 2020 xinghe - 5.4.0-1 - update version to 5.4.0