On Fri, Apr 15, 2016 at 05:27:28AM +0200, Theo Buehler wrote:

> > 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.
> 
> good catch
> 
> > This is an updated patch which removes mailcap configuration parsing.
> 
> Since this patch is obviously better than the previous version, I
> committed this one.

I received a bug report mentioning that invoking "lynx drudgereport"
crashed the program, and found out that Lynx sends an 'Accept-Encoding'
header saying it can handle bzip2 compressed HTML, and attempts to
uncompress the content by calling the bzip2 binary. It gets killed
by pledge when attempting that.

This can be mitigated by linking against bzlib, so the library will be
used instead of calling the bzip2 binary directly. I attached a patch
doing this.

Index: Makefile
===================================================================
RCS file: /cvs/ports/www/lynx/Makefile,v
retrieving revision 1.25
diff -u -p -u -p -r1.25 Makefile
--- Makefile    15 Apr 2016 03:21:51 -0000      1.25
+++ Makefile    22 Apr 2016 14:23:34 -0000
@@ -5,7 +5,7 @@ PL =            8
 COMMENT =      text web browser
 DISTNAME =     lynx${V}dev.${PL}
 PKGNAME =      lynx-${V}pl${PL}
-REVISION =     3
+REVISION =     4
 EXTRACT_SUFX = .tar.bz2
 CATEGORIES =   www net
 
@@ -17,12 +17,14 @@ MAINTAINER =        Frederic Cambus <fred@statd
 PERMIT_PACKAGE_CDROM = Yes
 
 # uses pledge()
-WANTLIB += c crypto ncurses ssl z
+WANTLIB += bz2 c crypto ncurses ssl z
 
 MASTER_SITES = http://lynx.invisible-island.net/current/ \
                http://invisible-mirror.net/archives/lynx/tarballs/ \
                http://invisible-mirror.net/archives/lynx/patches/
 
+LIB_DEPENDS =  archivers/bzip2
+
 CONFIGURE_STYLE =      gnu
 CONFIGURE_ARGS =       --datarootdir="${PREFIX}/share/doc/lynx" \
                        --disable-idna \
@@ -34,7 +36,8 @@ CONFIGURE_ARGS =      --datarootdir="${PREFIX
                        --enable-ipv6 \
                        --enable-widec \
                        --with-ssl=/usr \
-                       --with-zlib
+                       --with-zlib \
+                       --with-bzlib
 
 # This disables most calls to getpw*(3) so we can avoid pledge "getpw".
 CONFIGURE_ENV =        CFLAGS="-DNOUSERS"

Reply via email to