diff --git a/textproc/scdoc/Makefile b/textproc/scdoc/Makefile index 7299b99c439..f688aa80308 100644 --- a/textproc/scdoc/Makefile +++ b/textproc/scdoc/Makefile @@ -1,7 +1,7 @@ -# $OpenBSD: Makefile,v 1.2 2020/04/04 16:58:26 schwarze Exp $ +# $OpenBSD: Makefile,v 1.3 2021/03/16 17:00:59 sthen Exp $ COMMENT = convert scdoc text files to man(7) pages -VERSION = 1.10.1 +VERSION = 1.11.1 DISTNAME = scdoc-${VERSION} CATEGORIES = textproc HOMEPAGE = https://git.sr.ht/~sircmpwn/scdoc @@ -12,6 +12,7 @@ PERMIT_PACKAGE = Yes MASTER_SITES = https://git.sr.ht/~sircmpwn/scdoc/ DISTFILES = scdoc-{archive/}${VERSION}${EXTRACT_SUFX} +# uses pledge(2) WANTLIB = c USE_GMAKE = Yes diff --git a/textproc/scdoc/distinfo b/textproc/scdoc/distinfo index 1fa1d733fe5..b5714ae5183 100644 --- a/textproc/scdoc/distinfo +++ b/textproc/scdoc/distinfo @@ -1,2 +1,2 @@ -SHA256 (scdoc-1.10.1.tar.gz) = gOAhxzLMos1mWdzPMwbUb1nuy/j7qk2r21AvU3J4p48= -SIZE (scdoc-1.10.1.tar.gz) = 12422 +SHA256 (scdoc-1.11.1.tar.gz) = EJih7S4IdZb8Cz9lfByKXgBBImeqS682GeNoJDBmRbE= +SIZE (scdoc-1.11.1.tar.gz) = 12510 diff --git a/textproc/scdoc/patches/patch-src_main_c b/textproc/scdoc/patches/patch-src_main_c new file mode 100644 index 00000000000..6d855956423 --- /dev/null +++ b/textproc/scdoc/patches/patch-src_main_c @@ -0,0 +1,28 @@ +$OpenBSD: patch-src_main_c,v 1.1 2021/03/16 17:00:59 sthen Exp $ + +Simple software acting as an stdio filter, no third party libraries, +not big churn, so this is a good candidate for pledge. + +--- src/main.c.old ++++ src/main.c +@@ -15,6 +15,7 @@ + + char *strstr(const char *haystack, const char *needle); + char *strerror(int errnum); ++int pledge(const char *, const char *); + + static struct str *parse_section(struct parser *p) { + struct str *section = str_create(); +@@ -755,6 +756,12 @@ int main(int argc, char **argv) { + fprintf(stderr, "Usage: scdoc < input.scd > output.roff\n"); + return 1; + } ++ ++ if (pledge("stdio", NULL) == -1) { ++ fprintf(stderr, "pledge: %s", strerror(errno)); ++ exit(EXIT_FAILURE); ++ } ++ + struct parser p = { + .input = stdin, + .output = stdout,