On Thu, Apr 14, 2016 at 12:28:24AM +0200, Theo Buehler wrote:
> 
> Here's a cleaner version that makes no unnecessary change to lynx.cfg.
> 
> I'm going to commit this version tomorrow.

That makes sense to me, and I like tb@ approach it's much cleaner
indeed. However, it's still possible to override the hardcoded default
by setting GLOBAL_MAILCAP and PERSONAL_MAILCAP in /etc/lynx.cfg.

This is an updated patch which removes mailcap configuration parsing.

As per deraadt@ suggestion, I will contact upstream about those issues.

Index: Makefile
===================================================================
RCS file: /cvs/ports/www/lynx/Makefile,v
retrieving revision 1.24
diff -u -p -u -p -r1.24 Makefile
--- Makefile    12 Mar 2016 14:29:13 -0000      1.24
+++ Makefile    14 Apr 2016 20:35:41 -0000
@@ -5,7 +5,7 @@ PL =            8
 COMMENT =      text web browser
 DISTNAME =     lynx${V}dev.${PL}
 PKGNAME =      lynx-${V}pl${PL}
-REVISION =     2
+REVISION =     3
 EXTRACT_SUFX = .tar.bz2
 CATEGORIES =   www net
 
Index: patches/patch-lynx_cfg
===================================================================
RCS file: /cvs/ports/www/lynx/patches/patch-lynx_cfg,v
retrieving revision 1.2
diff -u -p -u -p -r1.2 patch-lynx_cfg
--- patches/patch-lynx_cfg      12 Jan 2016 16:05:54 -0000      1.2
+++ patches/patch-lynx_cfg      14 Apr 2016 20:35:41 -0000
@@ -1,6 +1,6 @@
 $OpenBSD: patch-lynx_cfg,v 1.2 2016/01/12 16:05:54 dcoppa Exp $
---- lynx.cfg.orig      Tue Jan 12 00:09:37 2016
-+++ lynx.cfg   Tue Jan 12 00:09:57 2016
+--- lynx.cfg.orig      Tue Dec 22 02:45:35 2015
++++ lynx.cfg   Wed Apr 13 23:26:29 2016
 @@ -90,7 +90,7 @@
  #
  # Normally we expect you will connect to a remote site, e.g., the Lynx 
starting
Index: patches/patch-lynx_man
===================================================================
RCS file: /cvs/ports/www/lynx/patches/patch-lynx_man,v
retrieving revision 1.1
diff -u -p -u -p -r1.1 patch-lynx_man
--- patches/patch-lynx_man      12 Mar 2016 14:29:13 -0000      1.1
+++ patches/patch-lynx_man      14 Apr 2016 20:35:41 -0000
@@ -1,12 +1,13 @@
 $OpenBSD: patch-lynx_man,v 1.1 2016/03/12 14:29:13 tb Exp $
 --- lynx.man.orig      Thu Oct  8 02:19:45 2015
-+++ lynx.man   Thu Feb  4 12:37:28 2016
-@@ -593,6 +593,21 @@ flushes the cache on a proxy server
++++ lynx.man   Wed Apr 13 13:03:58 2016
+@@ -593,6 +593,22 @@ flushes the cache on a proxy server
  allows a list of services to be disabled selectively.
  Dashes and underscores in option names can be intermixed.
  The following list is printed if no options are specified.
 +.IP
 +On OpenBSD the following restrictions are always enabled:
++\fBeditor\fR,
 +\fBexec\fR,
 +\fBmail\fR,
 +and
Index: patches/patch-src_LYMain_c
===================================================================
RCS file: /cvs/ports/www/lynx/patches/patch-src_LYMain_c,v
retrieving revision 1.1
diff -u -p -u -p -r1.1 patch-src_LYMain_c
--- patches/patch-src_LYMain_c  12 Mar 2016 14:29:13 -0000      1.1
+++ patches/patch-src_LYMain_c  14 Apr 2016 20:35:41 -0000
@@ -1,12 +1,13 @@
 $OpenBSD: patch-src_LYMain_c,v 1.1 2016/03/12 14:29:13 tb Exp $
 --- src/LYMain.c.orig  Fri Dec 18 01:34:45 2015
-+++ src/LYMain.c       Wed Feb  3 19:50:41 2016
-@@ -2142,6 +2142,21 @@ int main(int argc,
++++ src/LYMain.c       Mon Apr 11 01:55:21 2016
+@@ -2142,6 +2142,22 @@ int main(int argc,
      }
  
      /*
 +     * Disabling features requiring 'proc' + 'exec' and calling pledge
 +     */
++    no_editor = TRUE;
 +    no_exec = TRUE;
 +    no_mail = TRUE;
 +    no_shell = TRUE;
Index: patches/patch-src_LYReadCFG_c
===================================================================
RCS file: patches/patch-src_LYReadCFG_c
diff -N patches/patch-src_LYReadCFG_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_LYReadCFG_c       14 Apr 2016 20:35:41 -0000
@@ -0,0 +1,19 @@
+$OpenBSD$
+--- src/LYReadCFG.c.orig       Wed Apr 13 16:48:57 2016
++++ src/LYReadCFG.c    Wed Apr 13 16:49:39 2016
+@@ -1544,7 +1544,6 @@ static Config_Type Config_Table [] =
+ #endif
+      PARSE_Env(RC_FTP_PROXY,            0),
+      PARSE_STR(RC_GLOBAL_EXTENSION_MAP, global_extension_map),
+-     PARSE_STR(RC_GLOBAL_MAILCAP,       global_type_map),
+      PARSE_Env(RC_GOPHER_PROXY,         0),
+      PARSE_SET(RC_GOTOBUFFER,           goto_buffer),
+      PARSE_PRG(RC_GZIP_PATH,            ppGZIP),
+@@ -1662,7 +1661,6 @@ static Config_Type Config_Table [] =
+      PARSE_SET(RC_PERSISTENT_COOKIES,   persistent_cookies),
+ #endif /* USE_PERSISTENT_COOKIES */
+      PARSE_STR(RC_PERSONAL_EXTENSION_MAP, personal_extension_map),
+-     PARSE_STR(RC_PERSONAL_MAILCAP,     personal_type_map),
+      PARSE_LST(RC_POSITIONABLE_EDITOR,  positionable_editor),
+      PARSE_STR(RC_PREFERRED_CHARSET,    pref_charset),
+      PARSE_ENU(RC_PREFERRED_ENCODING,   LYAcceptEncoding, 
tbl_preferred_encoding),
Index: patches/patch-userdefs_h
===================================================================
RCS file: patches/patch-userdefs_h
diff -N patches/patch-userdefs_h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-userdefs_h    14 Apr 2016 20:35:41 -0000
@@ -0,0 +1,25 @@
+$OpenBSD$
+--- userdefs.h.orig    Tue Dec 22 02:45:35 2015
++++ userdefs.h Thu Apr 14 00:11:57 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.
+  */
+-#define GLOBAL_MAILCAP "Lynx_Dir:mailcap"
+-#define PERSONAL_MAILCAP ".mailcap"
++#define GLOBAL_MAILCAP "/dev/null"
++#define PERSONAL_MAILCAP "/dev/null"
+ 
+ /**************************
+  * XLOADIMAGE_COMMAND will be used as a default in src/HTInit.c
+@@ -327,8 +327,8 @@
+  * Mappings in these global and personal files override any VIEWER
+  * definitions in lynx.cfg and built-in defaults from src/HTInit.c.
+  */
+-#define GLOBAL_MAILCAP MIME_LIBDIR "mailcap"
+-#define PERSONAL_MAILCAP "~/.mailcap"
++#define GLOBAL_MAILCAP "/dev/null"
++#define PERSONAL_MAILCAP "/dev/null"
+ 
+ /**************************
+  * XLOADIMAGE_COMMAND will be used as a default in src/HTInit.c for

Reply via email to