ilibgit2 config opts: set the search to an empty path - 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 14e1c9b1fa56df83bb721805ca149fcc3a763d98 /git/stagit-gemini/commit/14e1c9b1fa56df83bb721805ca149fcc3a763d98.gph thinkerwim.org 70 1parent 41cb87952c8f4bc9ddc983875a60080473040cae /git/stagit-gemini/commit/41cb87952c8f4bc9ddc983875a60080473040cae.gph thinkerwim.org 70 hAuthor: Hiltjo Posthuma URL:mailto:hiltjo@codemadness.org thinkerwim.org 70 iDate: Mon, 3 Jan 2022 12:24:55 +0100 Err thinkerwim.openbsd.amsterdam 70 i Err thinkerwim.openbsd.amsterdam 70 ilibgit2 config opts: set the search to an empty path Err thinkerwim.openbsd.amsterdam 70 i Err thinkerwim.openbsd.amsterdam 70 iOtherwise this would search outside the unveiled paths and cause an unveil Err thinkerwim.openbsd.amsterdam 70 iviolation. Err thinkerwim.openbsd.amsterdam 70 i Err thinkerwim.openbsd.amsterdam 70 iReported by Anton Lindqvist, thanks! Err thinkerwim.openbsd.amsterdam 70 i Err thinkerwim.openbsd.amsterdam 70 iDiffstat: Err thinkerwim.openbsd.amsterdam 70 i M stagit-gopher-index.c | 4 ++++ Err thinkerwim.openbsd.amsterdam 70 i M stagit-gopher.c | 4 ++++ Err thinkerwim.openbsd.amsterdam 70 i Err thinkerwim.openbsd.amsterdam 70 i2 files changed, 8 insertions(+), 0 deletions(-) Err thinkerwim.openbsd.amsterdam 70 i--- 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@@ -238,7 +238,11 @@ main(int argc, char *argv[]) Err thinkerwim.openbsd.amsterdam 70 i Err thinkerwim.openbsd.amsterdam 70 i setlocale(LC_CTYPE, ""); Err thinkerwim.openbsd.amsterdam 70 i Err thinkerwim.openbsd.amsterdam 70 i+ /* do not search outside the git repository: Err thinkerwim.openbsd.amsterdam 70 i+ GIT_CONFIG_LEVEL_APP is the highest level currently */ Err thinkerwim.openbsd.amsterdam 70 i git_libgit2_init(); Err thinkerwim.openbsd.amsterdam 70 i+ for (i = 1; i <= GIT_CONFIG_LEVEL_APP; i++) Err thinkerwim.openbsd.amsterdam 70 i+ git_libgit2_opts(GIT_OPT_SET_SEARCH_PATH, i, ""); 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 1diff --git a/stagit-gopher.c b/stagit-gopher.c /git/stagit-gemini/file/stagit-gopher.c.gph thinkerwim.org 70 i@@ -1281,7 +1281,11 @@ main(int argc, char *argv[]) Err thinkerwim.openbsd.amsterdam 70 i if (!realpath(repodir, repodirabs)) Err thinkerwim.openbsd.amsterdam 70 i err(1, "realpath"); Err thinkerwim.openbsd.amsterdam 70 i Err thinkerwim.openbsd.amsterdam 70 i+ /* do not search outside the git repository: Err thinkerwim.openbsd.amsterdam 70 i+ GIT_CONFIG_LEVEL_APP is the highest level currently */ Err thinkerwim.openbsd.amsterdam 70 i git_libgit2_init(); Err thinkerwim.openbsd.amsterdam 70 i+ for (i = 1; i <= GIT_CONFIG_LEVEL_APP; i++) Err thinkerwim.openbsd.amsterdam 70 i+ git_libgit2_opts(GIT_OPT_SET_SEARCH_PATH, i, ""); Err thinkerwim.openbsd.amsterdam 70 i Err thinkerwim.openbsd.amsterdam 70 i #ifdef __OpenBSD__ Err thinkerwim.openbsd.amsterdam 70 i if (unveil(repodir, "r") == -1) Err thinkerwim.openbsd.amsterdam 70 .