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?
Index: Makefile
===================================================================
RCS file: /cvs/ports/www/lynx/Makefile,v
retrieving revision 1.27
diff -u -p -u -p -r1.27 Makefile
--- Makefile 17 May 2016 00:08:44 -0000 1.27
+++ Makefile 4 Jun 2016 21:24:14 -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-userdefs_h
===================================================================
RCS file: /cvs/ports/www/lynx/patches/patch-userdefs_h,v
retrieving revision 1.1
diff -u -p -u -p -r1.1 patch-userdefs_h
--- patches/patch-userdefs_h 15 Apr 2016 03:21:52 -0000 1.1
+++ patches/patch-userdefs_h 4 Jun 2016 21:24:14 -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