iassume OpenBSD 5.9+, always try pledge(2) on OpenBSD - stagit-gemini - Stagit for gemini protocol Openbsd Err thinkerwim.openbsd.amsterdam 70 hgit clone git://thinkerwim.org/stagit-gemini.git URL:git://thinkerwim.org/stagit-gemini.git thinkerwim.org 70 1Log /git/stagit-gemini/log.gph thinkerwim.org 70 1Files /git/stagit-gemini/files.gph thinkerwim.org 70 1Refs /git/stagit-gemini/refs.gph thinkerwim.org 70 1README /git/stagit-gemini/file/README.gph thinkerwim.org 70 1LICENSE /git/stagit-gemini/file/LICENSE.gph thinkerwim.org 70 i--- Err thinkerwim.openbsd.amsterdam 70 1commit 4af56862f25af790ce711ffcfefb792b42042b0d /git/stagit-gemini/commit/4af56862f25af790ce711ffcfefb792b42042b0d.gph thinkerwim.org 70 1parent f2bd82599fbf7d3d9c2f7682ee0f09318aa1e798 /git/stagit-gemini/commit/f2bd82599fbf7d3d9c2f7682ee0f09318aa1e798.gph thinkerwim.org 70 hAuthor: Hiltjo Posthuma URL:mailto:hiltjo@codemadness.org thinkerwim.org 70 iDate: Fri, 25 May 2018 18:42:35 +0200 Err thinkerwim.openbsd.amsterdam 70 i Err thinkerwim.openbsd.amsterdam 70 iassume OpenBSD 5.9+, always try pledge(2) on OpenBSD Err thinkerwim.openbsd.amsterdam 70 i Err thinkerwim.openbsd.amsterdam 70 iDiffstat: Err thinkerwim.openbsd.amsterdam 70 i M config.mk | 3 --- Err thinkerwim.openbsd.amsterdam 70 i M stagit-gopher-index.c | 6 ++---- Err thinkerwim.openbsd.amsterdam 70 i M stagit-gopher.c | 6 ++---- Err thinkerwim.openbsd.amsterdam 70 i Err thinkerwim.openbsd.amsterdam 70 i3 files changed, 4 insertions(+), 11 deletions(-) Err thinkerwim.openbsd.amsterdam 70 i--- Err thinkerwim.openbsd.amsterdam 70 1diff --git a/config.mk b/config.mk /git/stagit-gemini/file/config.mk.gph thinkerwim.org 70 i@@ -27,6 +27,3 @@ LDFLAGS = -s ${LIBS} Err thinkerwim.openbsd.amsterdam 70 i #LDFLAGS = -static -s ${LIBS} Err thinkerwim.openbsd.amsterdam 70 i Err thinkerwim.openbsd.amsterdam 70 i CPPFLAGS = -D_XOPEN_SOURCE=700 -D_DEFAULT_SOURCE -D_BSD_SOURCE ${INCS} Err thinkerwim.openbsd.amsterdam 70 i- Err thinkerwim.openbsd.amsterdam 70 i-# OpenBSD 5.9+: use pledge(2) Err thinkerwim.openbsd.amsterdam 70 i-#CPPFLAGS = -D_XOPEN_SOURCE=700 -D_DEFAULT_SOURCE -D_BSD_SOURCE -DUSE_PLEDGE ${INCS} Err thinkerwim.openbsd.amsterdam 70 1diff --git a/stagit-gopher-index.c b/stagit-gopher-index.c /git/stagit-gemini/file/stagit-gopher-index.c.gph thinkerwim.org 70 i@@ -22,10 +22,6 @@ static const char *relpath = ""; Err thinkerwim.openbsd.amsterdam 70 i static char description[255] = "Repositories"; Err thinkerwim.openbsd.amsterdam 70 i static char *name = ""; Err thinkerwim.openbsd.amsterdam 70 i Err thinkerwim.openbsd.amsterdam 70 i-#ifndef USE_PLEDGE Err thinkerwim.openbsd.amsterdam 70 i-#define pledge(p1,p2) 0 Err thinkerwim.openbsd.amsterdam 70 i-#endif Err thinkerwim.openbsd.amsterdam 70 i- Err thinkerwim.openbsd.amsterdam 70 i /* format `len' columns of characters. If string is shorter pad the rest Err thinkerwim.openbsd.amsterdam 70 i * with characters `pad`. */ Err thinkerwim.openbsd.amsterdam 70 i int Err thinkerwim.openbsd.amsterdam 70 i@@ -224,8 +220,10 @@ main(int argc, char *argv[]) Err thinkerwim.openbsd.amsterdam 70 i Err thinkerwim.openbsd.amsterdam 70 i git_libgit2_init(); Err thinkerwim.openbsd.amsterdam 70 i Err thinkerwim.openbsd.amsterdam 70 i+#ifdef __OpenBSD__ Err thinkerwim.openbsd.amsterdam 70 i if (pledge("stdio rpath", NULL) == -1) Err thinkerwim.openbsd.amsterdam 70 i err(1, "pledge"); Err thinkerwim.openbsd.amsterdam 70 i+#endif Err thinkerwim.openbsd.amsterdam 70 i Err thinkerwim.openbsd.amsterdam 70 i for (i = 1; i < argc; i++) { Err thinkerwim.openbsd.amsterdam 70 i if (argv[i][0] == '-') { Err thinkerwim.openbsd.amsterdam 70 1diff --git a/stagit-gopher.c b/stagit-gopher.c /git/stagit-gemini/file/stagit-gopher.c.gph thinkerwim.org 70 i@@ -67,10 +67,6 @@ static char lastoidstr[GIT_OID_HEXSZ + 2]; /* id + newline + nul byte */ Err thinkerwim.openbsd.amsterdam 70 i static FILE *rcachefp, *wcachefp; Err thinkerwim.openbsd.amsterdam 70 i static const char *cachefile; Err thinkerwim.openbsd.amsterdam 70 i Err thinkerwim.openbsd.amsterdam 70 i-#ifndef USE_PLEDGE Err thinkerwim.openbsd.amsterdam 70 i-#define pledge(p1,p2) 0 Err thinkerwim.openbsd.amsterdam 70 i-#endif Err thinkerwim.openbsd.amsterdam 70 i- Err thinkerwim.openbsd.amsterdam 70 i /* format `len' columns of characters. If string is shorter pad the rest Err thinkerwim.openbsd.amsterdam 70 i * with characters `pad`. */ Err thinkerwim.openbsd.amsterdam 70 i int Err thinkerwim.openbsd.amsterdam 70 i@@ -1150,6 +1146,7 @@ main(int argc, char *argv[]) Err thinkerwim.openbsd.amsterdam 70 i Err thinkerwim.openbsd.amsterdam 70 i git_libgit2_init(); Err thinkerwim.openbsd.amsterdam 70 i Err thinkerwim.openbsd.amsterdam 70 i+#ifdef __OpenBSD__ Err thinkerwim.openbsd.amsterdam 70 i if (cachefile) { Err thinkerwim.openbsd.amsterdam 70 i if (pledge("stdio rpath wpath cpath fattr", NULL) == -1) Err thinkerwim.openbsd.amsterdam 70 i err(1, "pledge"); Err thinkerwim.openbsd.amsterdam 70 i@@ -1157,6 +1154,7 @@ main(int argc, char *argv[]) Err thinkerwim.openbsd.amsterdam 70 i if (pledge("stdio rpath wpath cpath", NULL) == -1) Err thinkerwim.openbsd.amsterdam 70 i err(1, "pledge"); Err thinkerwim.openbsd.amsterdam 70 i } Err thinkerwim.openbsd.amsterdam 70 i+#endif Err thinkerwim.openbsd.amsterdam 70 i Err thinkerwim.openbsd.amsterdam 70 i if (git_repository_open_ext(&repo, repodir, Err thinkerwim.openbsd.amsterdam 70 i GIT_REPOSITORY_OPEN_NO_SEARCH, NULL) < 0) { Err thinkerwim.openbsd.amsterdam 70 .