On Sat, Aug 12 2017, Stuart Henderson <s...@spacehopper.org> wrote:
> Is anyone interested in reviewing this?

Looks correct except for one "input" method: netstat -i support would
need proc and exec.  I guess you could just disable it instead of
widening the promise.

> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/net/bwm-ng/Makefile,v
> retrieving revision 1.12
> diff -u -p -r1.12 Makefile
> --- Makefile  17 Jan 2016 22:51:33 -0000      1.12
> +++ Makefile  12 Aug 2017 12:49:10 -0000
> @@ -3,6 +3,7 @@
>  COMMENT=             realtime bandwidth monitoring of interfaces
>  
>  DISTNAME=            bwm-ng-0.6.1
> +REVISION=            0
>  CATEGORIES=          net
>  MASTER_SITES=                ${MASTER_SITE_SOURCEFORGE:=bwmng/}
>  HOMEPAGE=            http://www.gropp.org/
> @@ -12,6 +13,7 @@ MAINTAINER=         Stuart Henderson <sthen@ope
>  # GPLv2+
>  PERMIT_PACKAGE_CDROM=   Yes
>  
> +# uses pledge()
>  WANTLIB=             c curses
>  
>  CONFIGURE_STYLE=     gnu
> Index: patches/patch-src_bwm-ng_c
> ===================================================================
> RCS file: patches/patch-src_bwm-ng_c
> diff -N patches/patch-src_bwm-ng_c
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-src_bwm-ng_c        12 Aug 2017 12:49:10 -0000
> @@ -0,0 +1,22 @@
> +$OpenBSD$
> +
> +unix:  performs ioctl on interfaces to check if they're up (press "a" three 
> times)
> +route: retrieves interface stats via sysctl
> +
> +Index: src/bwm-ng.c
> +--- src/bwm-ng.c.orig
> ++++ src/bwm-ng.c
> +@@ -211,6 +211,13 @@ int main (int argc, char *argv[]) {
> +     /* end of init curses, now set a sigint handler to deinit the screen on 
> ctrl-break */
> +     signal(SIGINT,sigint);
> +     signal(SIGTERM,sigint);
> ++    if (out_file_path) {
> ++            if (pledge("stdio unix cpath wpath route tty", NULL) == -1)
> ++                    deinit(1, "pledge\n");
> ++    } else {
> ++            if (pledge("stdio unix route tty", NULL) == -1)
> ++                    deinit(1, "pledge\n");
> ++    }
> + #ifdef CSV  
> +     /* get stats without verbose if cvs */
> +     if (output_method==CSV_OUT && output_count>-1) {
>

-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE

Reply via email to