From fb9a514f5c9b20398105038b8bc2e6443767de9d Mon Sep 17 00:00:00 2001 From: mestre Date: Mon, 21 Mar 2016 17:41:52 +0000 Subject: [PATCH] pledge(2) urlview: rpath: read config file tty: the interface it's based on curses so it needs to do operations on tty proc/exec: this is needed to actually launch the external program after selecting the link OK jca@ after his suggestions --- textproc/urlview/Makefile | 5 +++-- textproc/urlview/patches/patch-urlview_c | 18 +++++++++++++++--- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/textproc/urlview/Makefile b/textproc/urlview/Makefile index dcaaca3ee05..fb7312a2481 100644 --- a/textproc/urlview/Makefile +++ b/textproc/urlview/Makefile @@ -1,9 +1,9 @@ -# $OpenBSD: Makefile,v 1.26 2015/10/09 12:48:22 jasper Exp $ +# $OpenBSD: Makefile,v 1.27 2016/03/21 17:41:52 mestre Exp $ COMMENT= curses-based URL ripper DISTNAME= urlview-0.9 -REVISION= 6 +REVISION= 7 CATEGORIES= textproc MASTER_SITES= ftp://ftp.fu-berlin.de/pub/unix/mail/mutt/contrib/ \ ftp://ftp.gbnet.net/pub/mutt-international/contrib/ @@ -23,6 +23,7 @@ RUN_DEPENDS= devel/xdg-utils FLAVORS= slang FLAVOR?= +# uses pledge() .if ${FLAVOR:Mslang} WANTLIB+= slang curses m LIB_DEPENDS= devel/libslang diff --git a/textproc/urlview/patches/patch-urlview_c b/textproc/urlview/patches/patch-urlview_c index cd61adb53eb..a8d7bc77f78 100644 --- a/textproc/urlview/patches/patch-urlview_c +++ b/textproc/urlview/patches/patch-urlview_c @@ -1,6 +1,6 @@ -$OpenBSD: patch-urlview_c,v 1.3 2009/12/23 22:04:18 jasper Exp $ ---- urlview.c.orig Tue Jul 4 12:14:30 2000 -+++ urlview.c Sun Jan 29 15:41:28 2006 +$OpenBSD: patch-urlview_c,v 1.4 2016/03/21 17:41:52 mestre Exp $ +--- urlview.c.orig Tue Jul 4 11:14:30 2000 ++++ urlview.c Mon Mar 21 12:38:33 2016 @@ -46,9 +46,11 @@ #include #endif @@ -14,3 +14,15 @@ $OpenBSD: patch-urlview_c,v 1.3 2009/12/23 22:04:18 jasper Exp $ #define OFFSET 2 #define PAGELEN (LINES - 1 - OFFSET) +@@ -187,6 +189,11 @@ int main (int argc, char **argv) + + pw = getpwuid (getuid ()); + snprintf (buf, sizeof (buf), "%s/.urlview", pw->pw_dir); ++ ++ if (pledge("stdio rpath tty proc exec", NULL) == -1) { ++ perror("pledge"); ++ exit(1); ++ } + + /*** Check for users rc-file ***/ + if (stat (buf,&stat_buf) == -1)