On Sat, Jun 04, 2016 at 11:30:09PM +0200, Frederic Cambus wrote: > On Thu, Jun 02, 2016 at 03:18:02PM +0200, Dmitrij D. Czarkoff wrote: > > > > 1. Currently lynx dies to SIGABRT from pledge when user follows URL > > for image files. I guess the same happens when user configures > > mailcap or handlers for mime types. Properly removing this > > functionality from lynx would require a lot of time both right now > > and during upgrades. The patch below changes LYSystem() to return > > early pretending that system(3) failed. > > Here is a patch to disable spawning an external viewer. For info, > we do not read .mailcap anymore, neither from the hardcoded paths in > userdefs.h or from eventual user defined path in /etc/lynx.cfg. > > However, userdefs.h hardcodes a default external viewer, and this is > where it came from. This is now disabled entirely and cannot be > reactived from the configuration file. > > Comments? OK?
[...] Here is a more complete patch to address the issue. On top of disabling hardcoded XLOADIMAGE_COMMAND value, we also remove the possibility of setting a custom value in lynx.cfg. The ability to assign MIME types to external viewers via configuration file (via the VIEWER variables) is also disabled now. Comments? OK? Index: Makefile =================================================================== RCS file: /cvs/ports/www/lynx/Makefile,v retrieving revision 1.27 diff -u -p -r1.27 Makefile --- Makefile 17 May 2016 00:08:44 -0000 1.27 +++ Makefile 3 Sep 2016 20:34:21 -0000 @@ -5,6 +5,7 @@ PL = 9 COMMENT = text web browser DISTNAME = lynx${V}dev.${PL} PKGNAME = lynx-${V}pl${PL} +REVISION = 0 EXTRACT_SUFX = .tar.bz2 CATEGORIES = www net Index: patches/patch-src_LYReadCFG_c =================================================================== RCS file: /cvs/ports/www/lynx/patches/patch-src_LYReadCFG_c,v retrieving revision 1.1 diff -u -p -r1.1 patch-src_LYReadCFG_c --- patches/patch-src_LYReadCFG_c 15 Apr 2016 03:21:51 -0000 1.1 +++ patches/patch-src_LYReadCFG_c 3 Sep 2016 20:34:21 -0000 @@ -1,6 +1,6 @@ $OpenBSD: patch-src_LYReadCFG_c,v 1.1 2016/04/15 03:21:51 tb Exp $ ---- src/LYReadCFG.c.orig Wed Apr 13 16:48:57 2016 -+++ src/LYReadCFG.c Wed Apr 13 16:49:39 2016 +--- src/LYReadCFG.c.orig Fri Dec 18 02:58:34 2015 ++++ src/LYReadCFG.c Sat Sep 3 22:22:14 2016 @@ -1544,7 +1544,6 @@ static Config_Type Config_Table [] = #endif PARSE_Env(RC_FTP_PROXY, 0), @@ -17,3 +17,15 @@ $OpenBSD: patch-src_LYReadCFG_c,v 1.1 20 PARSE_LST(RC_POSITIONABLE_EDITOR, positionable_editor), PARSE_STR(RC_PREFERRED_CHARSET, pref_charset), PARSE_ENU(RC_PREFERRED_ENCODING, LYAcceptEncoding, tbl_preferred_encoding), +@@ -1773,11 +1771,9 @@ static Config_Type Config_Table [] = + PARSE_PRG(RC_UUDECODE_PATH, ppUUDECODE), + PARSE_SET(RC_VERBOSE_IMAGES, verbose_img), + PARSE_SET(RC_VI_KEYS_ALWAYS_ON, vi_keys), +- PARSE_FUN(RC_VIEWER, viewer_fun), + PARSE_Env(RC_WAIS_PROXY, 0), + PARSE_SET(RC_WAIT_VIEWER_TERMINATION, wait_viewer_termination), + PARSE_SET(RC_WITH_BACKSPACES, with_backspaces), +- PARSE_STR(RC_XLOADIMAGE_COMMAND, XLoadImageCommand), + PARSE_SET(RC_XHTML_PARSING, LYxhtml_parsing), + PARSE_PRG(RC_ZCAT_PATH, ppZCAT), + PARSE_PRG(RC_ZIP_PATH, ppZIP), Index: patches/patch-userdefs_h =================================================================== RCS file: /cvs/ports/www/lynx/patches/patch-userdefs_h,v retrieving revision 1.1 diff -u -p -r1.1 patch-userdefs_h --- patches/patch-userdefs_h 15 Apr 2016 03:21:52 -0000 1.1 +++ patches/patch-userdefs_h 3 Sep 2016 20:34:21 -0000 @@ -1,6 +1,6 @@ $OpenBSD: patch-userdefs_h,v 1.1 2016/04/15 03:21:52 tb Exp $ ---- userdefs.h.orig Tue Dec 22 02:45:35 2015 -+++ userdefs.h Thu Apr 14 00:11:57 2016 +--- userdefs.h.orig Mon Apr 11 02:42:17 2016 ++++ userdefs.h Sun Jun 5 00:31:29 2016 @@ -129,8 +129,8 @@ * Mappings in these global and personal files override any VIEWER * definitions in lynx.cfg and built-in defaults from src/HTInit.c. @@ -23,3 +23,12 @@ $OpenBSD: patch-userdefs_h,v 1.1 2016/04 /************************** * XLOADIMAGE_COMMAND will be used as a default in src/HTInit.c for +@@ -345,7 +345,7 @@ + * use any default viewers for image types. Note that open is used as + * the default for NeXT, instead of the XLOADIMAGE_COMMAND definition. + */ +-#define XLOADIMAGE_COMMAND "xli %s &" ++#define XLOADIMAGE_COMMAND NULL + + /************************** + * For UNIX systems, SYSTEM_MAIL and SYSTEM_MAIL_FLAGS are set by the