luatex: update to 1.18.0

Part of TeXlive 2024

* Lua-level checks for writing to files now similar to the TeX-level checks.
* If the Lua value texconfig.trace_extra_newline is set, blank lines are
  output in the log between macro parameters. In 2020–2023, this was the
  case by default; before that, such blank lines were never output, which
  is the behavior of the other engines.
This commit is contained in:
markd 2024-03-21 08:27:03 +00:00
parent ccd185ec97
commit 15e9622fd1
18 changed files with 6 additions and 1947 deletions

View File

@ -1,9 +1,8 @@
# $NetBSD: Makefile,v 1.115 2023/11/14 14:02:44 wiz Exp $
# $NetBSD: Makefile,v 1.116 2024/03/21 08:27:03 markd Exp $
PKGREVISION= 2
.include "../../print/texlive/Makefile.common"
PKGNAME= luatex-1.17.0
PKGNAME= luatex-1.18.0
CATEGORIES= print
HOMEPAGE= https://www.tug.org/web2c/

View File

@ -1,23 +1,7 @@
$NetBSD: distinfo,v 1.46 2024/02/19 09:49:20 markd Exp $
$NetBSD: distinfo,v 1.47 2024/03/21 08:27:03 markd Exp $
BLAKE2s (texlive-20230313-source.tar.xz) = cd85d09bb3b6bf613a40b3c2308da75596cb6a1b5e4c7b3fcd8e3e43f206c379
SHA512 (texlive-20230313-source.tar.xz) = 5874e7c9937ef63fdb03780f8137e0a63ad23a1b2a9d232a71bd2ab999669152981911fadc9c8ff3cf5e3a2cf828d575982b7fce1a15c101a62328d89d851a88
Size (texlive-20230313-source.tar.xz) = 68630148 bytes
BLAKE2s (texlive-20240312-source.tar.xz) = 72bccd07a7c210c1c5e3d86d72f3e86bfaf7c2922345f2e048c6336b2a1bd11b
SHA512 (texlive-20240312-source.tar.xz) = e7ed4eb419da789f82d4295819ba72d10766398fd20c8675742fcec985851917b2005d259e4c9bb952790472855115644297d92257878882a66315cc940b9210
Size (texlive-20240312-source.tar.xz) = 70140588 bytes
SHA1 (patch-libs_lua53_lua53-src_src_luaconf.h) = 824ee4ba2c324e1e01967b82a54621b6b6f3edd3
SHA1 (patch-texk_web2c_configure) = 474ea4f57d535e22355916d6d52d4490d1138cfe
SHA1 (patch-texk_web2c_luatexdir_ChangeLog) = d6520c468a21f61d5e0ba1b736825c09bf24edc6
SHA1 (patch-texk_web2c_luatexdir_NEWS) = a3aa2dabf8924ea7147ab049127370ba9ab654f2
SHA1 (patch-texk_web2c_luatexdir_font_writettf.c) = 08306db325464aea3af229f3516b4d0a8b7a1a2d
SHA1 (patch-texk_web2c_luatexdir_lua_llualib.c) = 012dd52cd97af785034622a502f208a82944de2a
SHA1 (patch-texk_web2c_luatexdir_lua_loslibext.c) = 683dfe122af6bf3d6b3d174b86db11e21689e772
SHA1 (patch-texk_web2c_luatexdir_lua_lpdflib.c) = 17f06ee6edddfce83692427181e8e81dbdc1ebba
SHA1 (patch-texk_web2c_luatexdir_lua_luainit.c) = ee602cc56a95a01c891e5ccb7985e840ad9f3d79
SHA1 (patch-texk_web2c_luatexdir_lua_luastuff.c) = 2eae3b71889079958c6342d157e89629ecd329c6
SHA1 (patch-texk_web2c_luatexdir_lua_luatex-api.h) = fc9000090b501caae4aa511d64e2bbdfd99d4945
SHA1 (patch-texk_web2c_luatexdir_lua_luatex-core.c) = ca8364cd60e9d459f689351c18274fe1042c9b2e
SHA1 (patch-texk_web2c_luatexdir_lua_luatex-core.lua) = 2ed168b58b31d5f919909863fb9fdf8d3eacc288
SHA1 (patch-texk_web2c_luatexdir_luafontloader_src_luafflib.c) = cb9d334bb9c272e591ccd1c1fc8538e7bcc7ffbd
SHA1 (patch-texk_web2c_luatexdir_luasocket_src_lua_preload.c) = 45125d1bb28145a22a81b0d7d4398958075c8cd6
SHA1 (patch-texk_web2c_luatexdir_luatex.c) = b9b499804d274e5f95b1d8e88e22d7800d85b02f
SHA1 (patch-texk_web2c_luatexdir_luatex_svnversion.h) = c4e8b57e58cedc8cc624ed71a34910cd7b2edabf
SHA1 (patch-texk_web2c_luatexdir_tex_texnodes.c) = ff191c6d29dc6beb22273737bacf5c23224c2f94

View File

@ -1,47 +0,0 @@
$NetBSD: patch-texk_web2c_luatexdir_ChangeLog,v 1.1 2023/05/24 12:03:35 markd Exp $
1.16.0 -> 1.17.0
--- texk/web2c/luatexdir/ChangeLog 2023/05/01 23:50:21 66983
+++ texk/web2c/luatexdir/ChangeLog 2023/05/02 15:26:43 66984
@@ -1,5 +1,39 @@
+2023-04-29 Luigi Scarso <luigi.scarso@gmail.com>
+ * LuaTeX 1.17.0
+
+2023-04-28 Luigi Scarso <luigi.scarso@gmail.com>
+ * new option --no-socket, same as --nosocket
+
+2023-04-27 Luigi Scarso <luigi.scarso@gmail.com>
+ * new option --socket to split socket and shell escape;
+ * the mime library is always available (Max Chernoff);
+ * Fixed ChangeLog
+
+2023-04-25 Luigi Scarso <luigi.scarso@gmail.com>
+ * socket library by default not enabled;
+ it is enabled with --shell-escape but not with --shell-restricted.
+ The option ---nosocket remains unchanged.
+ The two new functions os.socketgettime and os.socketsleep are
+ like socket.gettime and socket.sleep, but they are always available.
+ * Luatex 1.17.0
+
+2023-04-24 Luigi Scarso <luigi.scarso@gmail.com>
+ * static kpse.check_permissions in os.kpsepopen
+ * Fixed date in ChangeLog
+
+2023-04-23 Luigi Scarso <luigi.scarso@gmail.com>
+ * new os.kpsepopen -- replace io.popen if kpse is active.
+ * Luatex 1.16.2
+
+2023-04-18 Luigi Scarso <luigi.scarso@gmail.com>
+ * lua.setluaname(n, s) and lua.getluaname(n):
+ fixed mismatch between documentation and implementation (J. Friedrich).
+
+2023-03-30 Luigi Scarso <luigi.scarso@gmail.com>
+ * bugfix for setpdforigin() (A. Matthias)
+
2023-02-22 Luigi Scarso <luigi.scarso@gmail.com>
- * fix latelua data reference (side effect of deferred late additions) (H.Hagen)
+ * fix latelua data reference (side effect of deferred late additions) (H.Hagen)
2023-02-18 Luigi Scarso <luigi.scarso@gmail.com>
* Fixed the "Invalid unicode ranges in CMap beginbfrange operator bug" as in pdfTeX (Hàn Thế Thành)

View File

@ -1,38 +0,0 @@
$NetBSD: patch-texk_web2c_luatexdir_NEWS,v 1.1 2023/05/24 12:03:35 markd Exp $
1.16.0 -> 1.17.0
--- texk/web2c/luatexdir/NEWS 2023/05/01 23:50:21 66983
+++ texk/web2c/luatexdir/NEWS 2023/05/02 15:26:43 66984
@@ -1,4 +1,31 @@
==============================================================
+LuaTeX 1.17.0 2023-04-29
+==============================================================
+
+- A breaking backward compatibility change: by default the socket
+ library is not enabled.
+ The new option --socket enable the socket library as
+ before, as also --shell-escape (without --shell-restricted);
+ --nosocket, --no-socket , --safer disabled the library, and
+ they have the priority in case of conflicting options.
+
+ socket.sleep and socket.gettime are duplicated as os.socketsleep and
+ os.socketgettime, both always available.
+
+ The new function os.kpsepopen replaces io.popen in kpse mode
+ (i.e. when kpse_init is not zero) as it was before,
+ but the permission can no longer be changed with
+ kpse.check_permission.
+ The function os.kpsepopen follows the same restrictions
+ as io.popen.
+
+ The mime library is always available.
+
+ Thanks to Max Chernoff for debugging.
+
+
+
+==============================================================
LuaTeX 1.16.0 2023-02-19
==============================================================

View File

@ -1,20 +0,0 @@
$NetBSD: patch-texk_web2c_luatexdir_font_writettf.c,v 1.1 2023/05/24 12:03:35 markd Exp $
1.16.0 -> 1.17.0
--- texk/web2c/luatexdir/font/writettf.c 2023/05/01 23:50:21 66983
+++ texk/web2c/luatexdir/font/writettf.c 2023/05/02 15:26:43 66984
@@ -1518,7 +1518,7 @@ static void do_writeotf(PDF pdf, fd_entr
if (tracefilenames)
tex_printf("<<%s", cur_file_name);
ttf_read_tabdir();
- /*tex Read teh font parameters. */
+ /*tex Read the font parameters. */
if (ttf_name_lookup("head", false) != NULL)
ttf_read_head();
if (ttf_name_lookup("hhea", false) != NULL)
@@ -1570,4 +1570,3 @@ void writeotf(PDF pdf, fd_entry * fd)
xfree(ttf_buffer);
cur_file_name = NULL;
}
-

View File

@ -1,37 +0,0 @@
$NetBSD: patch-texk_web2c_luatexdir_lua_llualib.c,v 1.1 2023/05/24 12:03:35 markd Exp $
1.16.0 -> 1.17.0
--- texk/web2c/luatexdir/lua/llualib.c 2023/05/01 23:50:21 66983
+++ texk/web2c/luatexdir/lua/llualib.c 2023/05/02 15:26:43 66984
@@ -319,8 +319,8 @@ static int set_luaname(lua_State * L)
{
int k;
const char *s;
- if (lua_gettop(L) == 3) {
- k = (int) luaL_checkinteger(L, 2);
+ if (lua_gettop(L) == 2) {
+ k = (int) luaL_checkinteger(L, 1);
if (k > 65535 || k < 0) {
/* error */
} else {
@@ -328,8 +328,8 @@ static int set_luaname(lua_State * L)
free(luanames[k]);
luanames[k] = NULL;
}
- if (lua_type(L,3) == LUA_TSTRING) {
- s = lua_tostring(L, 3);
+ if (lua_type(L, 2) == LUA_TSTRING) {
+ s = lua_tostring(L, 2);
if (s != NULL)
luanames[k] = xstrdup(s);
}
@@ -340,7 +340,7 @@ static int set_luaname(lua_State * L)
static int get_luaname(lua_State * L)
{
- int k = (int) luaL_checkinteger(L, 2);
+ int k = (int) luaL_checkinteger(L, 1);
if (k > 65535 || k < 0) {
/* error */
lua_pushnil(L);

View File

@ -1,190 +0,0 @@
$NetBSD: patch-texk_web2c_luatexdir_lua_loslibext.c,v 1.1 2023/05/24 12:03:35 markd Exp $
1.16.0 -> 1.17.0
--- texk/web2c/luatexdir/lua/loslibext.c 2023/05/01 23:50:21 66983
+++ texk/web2c/luatexdir/lua/loslibext.c 2023/05/02 15:26:43 66984
@@ -1047,6 +1047,167 @@ static int os_execute(lua_State * L)
}
+/*
+** ======================================================
+** l_kpse_popen spawns a new process connected to the current
+** one through the file streams with some checks by kpse.
+** Almost verbatim from Lua liolib.c .
+** =======================================================
+*/
+#if !defined(l_kpse_popen) /* { */
+
+#if defined(LUA_USE_POSIX) /* { */
+
+#define l_kpse_popen(L,c,m) (fflush(NULL), popen(c,m))
+#define l_kpse_pclose(L,file) (pclose(file))
+
+#elif defined(LUA_USE_WINDOWS) /* }{ */
+
+#define l_kpse_popen(L,c,m) (_popen(c,m))
+#define l_kpse_pclose(L,file) (_pclose(file))
+
+#else /* }{ */
+
+/* ISO C definitions */
+#define l_kpse_popen(L,c,m) \
+ ((void)((void)c, m), \
+ luaL_error(L, "'popen' not supported"), \
+ (FILE*)0)
+#define l_kpse_pclose(L,file) ((void)L, (void)file, -1)
+
+#endif /* } */
+
+#endif /* } */
+typedef luaL_Stream LStream;
+#define tolstream(L) ((LStream *)luaL_checkudata(L, 1, LUA_FILEHANDLE))
+static LStream *newprefile (lua_State *L) {
+ LStream *p = (LStream *)lua_newuserdata(L, sizeof(LStream));
+ p->closef = NULL; /* mark file handle as 'closed' */
+ luaL_setmetatable(L, LUA_FILEHANDLE);
+ return p;
+}
+static int io_kpse_pclose (lua_State *L) {
+ LStream *p = tolstream(L);
+ return luaL_execresult(L, l_kpse_pclose(L, p->f));
+}
+static int io_kpse_check_permissions(lua_State *L) {
+ const char *filename = luaL_checkstring(L, 1);
+ if (filename == NULL) {
+ lua_pushboolean(L,0);
+ lua_pushliteral(L,"no command name given");
+ } else if (shellenabledp <= 0) {
+ lua_pushboolean(L,0);
+ lua_pushliteral(L,"all command execution is disabled");
+ } else if (restrictedshell == 0) {
+ lua_pushboolean(L,1);
+ lua_pushstring(L,filename);
+ } else {
+ char *safecmd = NULL;
+ char *cmdname = NULL;
+ switch (shell_cmd_is_allowed(filename, &safecmd, &cmdname)) {
+ case 0:
+ lua_pushboolean(L,0);
+ lua_pushliteral(L, "specific command execution disabled");
+ break;
+ case 1:
+ /* doesn't happen */
+ lua_pushboolean(L,1);
+ lua_pushstring(L,filename);
+ break;
+ case 2:
+ lua_pushboolean(L,1);
+ lua_pushstring(L,safecmd);
+ break;
+ default:
+ /* -1 */
+ lua_pushboolean(L,0);
+ lua_pushliteral(L, "bad command line quoting");
+ break;
+ }
+ }
+ return 2;
+}
+static int io_kpse_popen (lua_State *L) {
+ const char *filename = NULL;
+ const char *mode = NULL;
+ LStream *p = NULL;
+ int okay;
+ filename = luaL_checkstring(L, 1);
+ mode = luaL_optstring(L, 2, "r");
+ lua_pushstring(L,filename);
+ io_kpse_check_permissions(L);
+ filename = luaL_checkstring(L, -1);
+ okay = lua_toboolean(L,-2);
+ if (okay && filename) {
+ p = newprefile(L);
+ luaL_argcheck(L, ((mode[0] == 'r' || mode[0] == 'w') && mode[1] == '\0'),
+ 2, "invalid mode");
+ p->f = l_kpse_popen(L, filename, mode);
+ p->closef = &io_kpse_pclose;
+ return (p->f == NULL) ? luaL_fileresult(L, 0, filename) : 1;
+ } else {
+ lua_pushnil(L);
+ lua_pushvalue(L,-2);
+ return 2;
+ }
+}
+
+
+
+/* socket.sleep and socket.gettime */
+/* are duplicated here, and they are */
+/* always available (the socket library */
+/* can be nil in some setups) */
+#ifdef _WIN32
+static int socket_timeout_lua_sleep(lua_State *L)
+{
+ double n = luaL_checknumber(L, 1);
+ if (n < 0.0) n = 0.0;
+ if (n < DBL_MAX/1000.0) n *= 1000.0;
+ if (n > INT_MAX) n = INT_MAX;
+ Sleep((int)n);
+ return 0;
+}
+static double socket_timeout_gettime(void) {
+ FILETIME ft;
+ double t;
+ GetSystemTimeAsFileTime(&ft);
+ /* Windows file time (time since January 1, 1601 (UTC)) */
+ t = ft.dwLowDateTime/1.0e7 + ft.dwHighDateTime*(4294967296.0/1.0e7);
+ /* convert to Unix Epoch time (time since January 1, 1970 (UTC)) */
+ return (t - 11644473600.0);
+}
+#else
+static int socket_timeout_lua_sleep(lua_State *L)
+{
+ double n = luaL_checknumber(L, 1);
+ struct timespec t, r;
+ if (n < 0.0) n = 0.0;
+ if (n > INT_MAX) n = INT_MAX;
+ t.tv_sec = (int) n;
+ n -= t.tv_sec;
+ t.tv_nsec = (int) (n * 1000000000);
+ if (t.tv_nsec >= 1000000000) t.tv_nsec = 999999999;
+ while (nanosleep(&t, &r) != 0) {
+ t.tv_sec = r.tv_sec;
+ t.tv_nsec = r.tv_nsec;
+ }
+ return 0;
+}
+static double socket_timeout_gettime(void) {
+ struct timeval v;
+ gettimeofday(&v, (struct timezone *) NULL);
+ /* Unix Epoch time (time since January 1, 1970 (UTC)) */
+ return v.tv_sec + v.tv_usec/1.0e6;
+}
+#endif
+static int socket_timeout_lua_gettime(lua_State *L)
+{
+ lua_pushnumber(L, socket_timeout_gettime());
+ return 1;
+}
+
+
void open_oslibext(lua_State * L)
{
@@ -1081,5 +1242,15 @@ void open_oslibext(lua_State * L)
lua_pushcfunction(L, os_tmpdir);
lua_setfield(L, -2, "tmpdir");
+ lua_pushcfunction(L, io_kpse_popen);
+ lua_setfield(L, -2, "kpsepopen");
+
+ lua_pushcfunction(L, socket_timeout_lua_sleep);
+ lua_setfield(L, -2, "socketsleep");
+
+ lua_pushcfunction(L, socket_timeout_lua_gettime);
+ lua_setfield(L, -2, "socketgettime");
+
+
lua_pop(L, 1); /* pop the table */
}

View File

@ -1,15 +0,0 @@
$NetBSD: patch-texk_web2c_luatexdir_lua_lpdflib.c,v 1.1 2023/05/24 12:03:35 markd Exp $
1.16.0 -> 1.17.0
--- texk/web2c/luatexdir/lua/lpdflib.c 2023/05/01 23:50:21 66983
+++ texk/web2c/luatexdir/lua/lpdflib.c 2023/05/02 15:26:43 66984
@@ -1048,7 +1048,7 @@ static int setpdforigin(lua_State * L)
if (lua_type(L, 1) == LUA_TNUMBER) {
h = (int) lua_roundnumber(L, 1);
if (lua_type(L, 2) == LUA_TNUMBER) {
- v = (int) lua_roundnumber(L, 1);
+ v = (int) lua_roundnumber(L, 2);
} else {
v = h;
}

View File

@ -1,99 +0,0 @@
$NetBSD: patch-texk_web2c_luatexdir_lua_luainit.c,v 1.1 2023/05/24 12:03:35 markd Exp $
1.16.0 -> 1.17.0
--- texk/web2c/luatexdir/lua/luainit.c 2023/05/01 23:50:21 66983
+++ texk/web2c/luatexdir/lua/luainit.c 2023/05/02 15:26:43 66984
@@ -85,6 +85,8 @@ const_string LUATEX_IHELP[] = {
" --lua=FILE load and execute a lua initialization script",
" --[no-]mktex=FMT disable/enable mktexFMT generation (FMT=tex/tfm)",
" --nosocket disable the lua socket library",
+ " --no-socket disable the lua socket library",
+ " --socket enable the lua socket library",
" --output-comment=STRING use STRING for DVI file comment instead of date (no effect for PDF)",
" --output-directory=DIR use existing DIR as the directory to write files in",
" --output-format=FORMAT use FORMAT for job output; FORMAT is 'dvi' or 'pdf'",
@@ -108,6 +110,7 @@ const_string LUATEX_IHELP[] = {
#endif
"",
"See the reference manual for more information about the startup process.",
+ "LuaTeX package page: https://ctan.org/pkg/luatex",
NULL
};
@@ -212,9 +215,30 @@ char *jithash_hashname = NULL;
#endif
int safer_option = 0;
-int nosocket_option = 0;
+int nosocket_option = 1;
+int nosocket_cli_option = 0;
+int yessocket_cli_option = 0;
+int socket_bitmask = 0;
int utc_option = 0;
+/*tex We use a bitmask for the socket library: |0000| and |1xxx| implies |--nosocket|,
+ otherwise the socket library is enabled. Default value is |0000|, i.e. |--nosocket|.
+*/
+#define UPDATE_SOCKET_STATUS() do { \
+ socket_bitmask = 0; \
+ socket_bitmask = safer_option==1? (8+socket_bitmask):socket_bitmask;\
+ socket_bitmask = nosocket_cli_option==1? (4+socket_bitmask):socket_bitmask;\
+ socket_bitmask = (shellenabledp == 1 && restrictedshell == 0)?(2+socket_bitmask):socket_bitmask;\
+ socket_bitmask = yessocket_cli_option==1? (1+socket_bitmask):socket_bitmask;\
+ if( socket_bitmask==0) { \
+ nosocket_option = 1; \
+ } else if ( socket_bitmask<4) { \
+ nosocket_option = 0; \
+ } else { \
+ nosocket_option = 1; \
+ } \
+} while (0)
+
/*tex
Test whether getopt found an option ``A''. Assumes the option index is in the
@@ -242,7 +266,9 @@ static struct option long_options[] = {
#endif
{"safer", 0, &safer_option, 1},
{"utc", 0, &utc_option, 1},
- {"nosocket", 0, &nosocket_option, 1},
+ {"nosocket", 0, &nosocket_cli_option, 1},
+ {"no-socket", 0, &nosocket_cli_option, 1},
+ {"socket", 0, &yessocket_cli_option, 1},
{"help", 0, 0, 0},
{"ini", 0, &ini_version, 1},
{"interaction", 1, 0, 0},
@@ -524,14 +550,11 @@ static void parse_options(int ac, char *
input_name = xstrdup(sargv[sargc-1]);
sargv[sargc-1] = normalize_quotes(input_name, "argument");
}
- if (safer_option) /* --safer implies --nosocket */
- nosocket_option = 1;
+ UPDATE_SOCKET_STATUS();
return;
#endif
}
- /*tex |--safer| implies |--nosocket| */
- if (safer_option)
- nosocket_option = 1;
+ UPDATE_SOCKET_STATUS();
/*tex Finalize the input filename. */
if (input_name != NULL) {
argv[optind] = normalize_quotes(input_name, "argument");
@@ -981,6 +1004,7 @@ void lua_initialize(int ac, char **av)
shellenabledp = true;
restrictedshell = false;
safer_option = 0;
+ nosocket_option = 0;
}
/*tex
Get the current locale (it should be |C|) and save |LC_CTYPE|, |LC_COLLATE|
@@ -1149,6 +1173,7 @@ void lua_initialize(int ac, char **av)
}
free(v1);
}
+ UPDATE_SOCKET_STATUS();
/*tex If shell escapes are restricted, get allowed cmds from cnf. */
if (shellenabledp && restrictedshell == 1) {
v1 = NULL;

View File

@ -1,40 +0,0 @@
$NetBSD: patch-texk_web2c_luatexdir_lua_luastuff.c,v 1.1 2023/05/24 12:03:35 markd Exp $
1.16.0 -> 1.17.0
--- texk/web2c/luatexdir/lua/luastuff.c 2023/05/01 23:50:21 66983
+++ texk/web2c/luatexdir/lua/luastuff.c 2023/05/02 15:26:43 66984
@@ -323,7 +323,8 @@ void luainterpreter(void)
/*tex
The socket and mime libraries are a bit tricky to open because they use a
load-time dependency that has to be worked around for luatex, where the C
- module is loaded way before the lua module.
+ module is loaded way before the lua module.
+ The mime library is always available, even if the socket library is not enabled.
*/
if (!nosocket_option) {
/* todo: move this to common */
@@ -348,6 +349,23 @@ void luainterpreter(void)
lua_pop(L, 2);
/*tex preload the pure \LUA\ modules */
luatex_socketlua_open(L);
+ } else {
+ lua_getglobal(L, "package");
+ lua_getfield(L, -1, "loaded");
+ if (!lua_istable(L, -1)) {
+ lua_newtable(L);
+ lua_setfield(L, -2, "loaded");
+ lua_getfield(L, -1, "loaded");
+ }
+ /*tex |package.loaded.mime = nil| */
+ luaopen_mime_core(L);
+ lua_setfield(L, -2, "mime.core");
+ lua_pushnil(L);
+ lua_setfield(L, -2, "mime");
+ /*tex pop the table */
+ lua_pop(L, 1);
+ /*tex preload the pure \LUA\ mime module */
+ luatex_socketlua_safe_open(L);
}
luaopen_zlib(L);
luaopen_gzip(L);

View File

@ -1,14 +0,0 @@
$NetBSD: patch-texk_web2c_luatexdir_lua_luatex-api.h,v 1.1 2023/05/24 12:03:35 markd Exp $
1.16.0 -> 1.17.0
--- texk/web2c/luatexdir/lua/luatex-api.h 2023/05/01 23:50:21 66983
+++ texk/web2c/luatexdir/lua/luatex-api.h 2023/05/02 15:26:43 66984
@@ -123,6 +123,7 @@ extern int luaopen_profiler(lua_State *
extern int luaopen_socket_core(lua_State * L);
extern int luaopen_mime_core(lua_State * L);
extern void luatex_socketlua_open(lua_State * L);
+extern void luatex_socketlua_safe_open(lua_State * L);
extern int luaopen_img(lua_State * L);
extern int l_new_image(lua_State * L);

View File

@ -1,72 +0,0 @@
$NetBSD: patch-texk_web2c_luatexdir_lua_luatex-core.lua,v 1.1 2023/05/24 12:03:35 markd Exp $
1.16.0 -> 1.17.0
--- texk/web2c/luatexdir/lua/luatex-core.lua 2023/05/01 23:50:21 66983
+++ texk/web2c/luatexdir/lua/luatex-core.lua 2023/05/02 15:26:43 66984
@@ -7,7 +7,7 @@
-- copyright = 'LuaTeX Development Team',
-- }
-LUATEXCOREVERSION = 1.151 -- we reflect the luatex version where changes happened
+LUATEXCOREVERSION = 1.161 -- we reflect the luatex version where changes happened
-- This file overloads some Lua functions. The readline variants provide the same
-- functionality as LuaTeX <= 1.04 and doing it this way permits us to keep the
@@ -16,6 +16,8 @@ LUATEXCOREVERSION = 1.151 -- we reflect
-- We test for functions already being defined so that we don't overload ones that
-- are provided in the startup script.
+
+
local saferoption = status.safer_option
local shellescape = status.shell_escape -- 0 (disabled) 1 (anything) 2 (restricted)
local kpseused = status.kpse_used -- 0 1
@@ -34,7 +36,7 @@ if kpseused == 1 then
local kpse_recordoutputfile = kpse.record_output_file
local io_open = io.open
- local io_popen = io.popen
+ -- local io_popen = io.popen -- not need, we use os.kpsepopen
local io_lines = io.lines
local fio_readline = fio.readline
@@ -75,12 +77,13 @@ if kpseused == 1 then
return f
end
- local function luatex_io_popen(name,...)
- local okay, found = kpse_checkpermission(name)
- if okay and found then
- return io_popen(found,...)
- end
- end
+ -- not need, we use os.kpsepopen
+ --local function luatex_io_popen(name,...)
+ -- local okay, found = kpse_checkpermission(name)
+ -- if okay and found then
+ -- return io_popen(found,...)
+ -- end
+ --end
-- local function luatex_io_lines(name,how)
-- if name then
@@ -130,7 +133,8 @@ if kpseused == 1 then
mt.lines = luatex_io_readline
io.open = luatex_io_open
- io.popen = luatex_io_popen
+ --io.popen = luatex_io_popen -- not need, we use os.kpsepopen
+ io.popen = os.kpsepopen
else
@@ -169,6 +173,8 @@ if saferoption == 1 then
os.setenv = installdummy("os.setenv")
os.tempdir = installdummy("os.tempdir")
+ os.kpsepopen = installdummy("os.kpsepopen")
+
io.popen = installdummy("io.popen")
io.open = installdummy("io.open",luatex_io_open_readonly)

View File

@ -1,14 +0,0 @@
$NetBSD: patch-texk_web2c_luatexdir_luafontloader_src_luafflib.c,v 1.1 2023/05/24 12:03:35 markd Exp $
1.16.0 -> 1.17.0
--- texk/web2c/luatexdir/luafontloader/src/luafflib.c 2023/05/01 23:50:21 66983
+++ texk/web2c/luatexdir/luafontloader/src/luafflib.c 2023/05/02 15:26:43 66984
@@ -1236,7 +1236,6 @@ static void handle_pfminfo(lua_State * L
dump_intfield(L, "vlinegap", pfm.vlinegap);
dump_intfield(L, "hhead_ascent", pfm.hhead_ascent);
dump_intfield(L, "hhead_descent", pfm.hhead_descent);
- dump_intfield(L, "hhead_descent", pfm.hhead_descent);
dump_intfield(L, "os2_typoascent", pfm.os2_typoascent);
dump_intfield(L, "os2_typodescent", pfm.os2_typodescent);
dump_intfield(L, "os2_typolinegap", pfm.os2_typolinegap);

View File

@ -1,26 +0,0 @@
$NetBSD: patch-texk_web2c_luatexdir_luasocket_src_lua_preload.c,v 1.1 2023/05/24 12:03:35 markd Exp $
1.16.0 -1.17.0
--- texk/web2c/luatexdir/luasocket/src/lua_preload.c 2023/05/01 23:50:21 66983
+++ texk/web2c/luatexdir/luasocket/src/lua_preload.c 2023/05/02 15:26:43 66984
@@ -16,6 +16,7 @@ int luatex_ftp_lua_open(lua_State*);
extern void luatex_socketlua_open (lua_State *) ;
+extern void luatex_socketlua_safe_open (lua_State *) ;
#include "ftp_lua.c"
#include "headers_lua.c"
#include "http_lua.c"
@@ -47,3 +48,11 @@ luatex_socketlua_open (lua_State *L) {
TEST(luatex_http_lua_open(L));
TEST(luatex_ftp_lua_open(L));
}
+
+/* luatex_socketlua_safe_open: load safe modules */
+/* of luasocket ( mime ). */
+void
+luatex_socketlua_safe_open (lua_State *L) {
+ TEST(luatex_ltn12_lua_open(L));
+ TEST(luatex_mime_lua_open(L));
+}

View File

@ -1,18 +0,0 @@
$NetBSD: patch-texk_web2c_luatexdir_luatex.c,v 1.3 2023/05/24 12:03:35 markd Exp $
1.16.0 -> 1.17.0
--- texk/web2c/luatexdir/luatex.c 2023/05/01 23:50:21 66983
+++ texk/web2c/luatexdir/luatex.c 2023/05/02 15:26:43 66984
@@ -32,9 +32,9 @@
stick to "0" upto "9" so users can expect a number represented as string.
*/
-int luatex_version = 116;
+int luatex_version = 117;
int luatex_revision = '0';
-const char *luatex_version_string = "1.16.0";
+const char *luatex_version_string = "1.17.0";
const char *engine_name = my_name;
#include <kpathsea/c-ctype.h>

View File

@ -1,12 +0,0 @@
$NetBSD: patch-texk_web2c_luatexdir_luatex_svnversion.h,v 1.1 2023/05/24 12:03:35 markd Exp $
1.16.0 -> 1.17.0
--- texk/web2c/luatexdir/luatex_svnversion.h 2023/05/01 23:50:21 66983
+++ texk/web2c/luatexdir/luatex_svnversion.h 2023/05/02 15:26:43 66984
@@ -1,4 +1,4 @@
#ifndef luatex_svn_revision_h
#define luatex_svn_revision_h
-#define luatex_svn_revision 7567
+#define luatex_svn_revision 7581
#endif

View File

@ -1,15 +0,0 @@
$NetBSD: patch-texk_web2c_luatexdir_tex_texnodes.c,v 1.1 2023/05/24 12:03:35 markd Exp $
1.16.0 -> 1.17.0
--- texk/web2c/luatexdir/tex/texnodes.c 2023/05/01 23:50:21 66983
+++ texk/web2c/luatexdir/tex/texnodes.c 2023/05/02 15:26:43 66984
@@ -1203,7 +1203,7 @@ void l_set_whatsit_data(void) {
the original one as a metatable. After some experiments (that also included
timing) with these scenarios I decided that a deep copy made no sense, nor
did nilling. In the end both the shallow copy and the metatable variant were
- both ok, although the second ons is slower. The most important aspect to keep
+ both ok, although the second one is slower. The most important aspect to keep
in mind is that references to other nodes in properties no longer can be
valid for that copy. We could use two tables (one unique and one shared) or
metatables but that only complicates matters.