Update to scdoc-1.11.1, and add pledge which is a good fit for this

software. From Martin Vahlensieck
This commit is contained in:
sthen 2021-03-16 17:00:59 +00:00
parent 2156c538bc
commit e77b39b0cf
3 changed files with 33 additions and 4 deletions

View File

@ -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

View File

@ -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

View File

@ -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,