ilibgit2 config opts: set the search to an empty path - stagit-gopher - A git gopher frontend. (mirror) Err bitreich.org 70
hgit clone git://bitreich.org/stagit-gopher/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/stagit-gopher/ URL:git://bitreich.org/stagit-gopher/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/stagit-gopher/ bitreich.org 70
1Log /scm/stagit-gopher/log.gph bitreich.org 70
1Files /scm/stagit-gopher/files.gph bitreich.org 70
1Refs /scm/stagit-gopher/refs.gph bitreich.org 70
1Tags /scm/stagit-gopher/tag bitreich.org 70
1README /scm/stagit-gopher/file/README.gph bitreich.org 70
1LICENSE /scm/stagit-gopher/file/LICENSE.gph bitreich.org 70
i--- Err bitreich.org 70
1commit 14e1c9b1fa56df83bb721805ca149fcc3a763d98 /scm/stagit-gopher/commit/14e1c9b1fa56df83bb721805ca149fcc3a763d98.gph bitreich.org 70
1parent 41cb87952c8f4bc9ddc983875a60080473040cae /scm/stagit-gopher/commit/41cb87952c8f4bc9ddc983875a60080473040cae.gph bitreich.org 70
hAuthor: Hiltjo Posthuma <hiltjo@codemadness.org> URL:mailto:hiltjo@codemadness.org bitreich.org 70
iDate: Mon, 3 Jan 2022 12:24:55 +0100 Err bitreich.org 70
i Err bitreich.org 70
ilibgit2 config opts: set the search to an empty path Err bitreich.org 70
i Err bitreich.org 70
iOtherwise this would search outside the unveiled paths and cause an unveil Err bitreich.org 70
iviolation. Err bitreich.org 70
i Err bitreich.org 70
iReported by Anton Lindqvist, thanks! Err bitreich.org 70
i Err bitreich.org 70
iDiffstat: Err bitreich.org 70
i M stagit-gopher-index.c | 4 ++++ Err bitreich.org 70
i M stagit-gopher.c | 4 ++++ Err bitreich.org 70
i Err bitreich.org 70
i2 files changed, 8 insertions(+), 0 deletions(-) Err bitreich.org 70
i--- Err bitreich.org 70
1diff --git a/stagit-gopher-index.c b/stagit-gopher-index.c /scm/stagit-gopher/file/stagit-gopher-index.c.gph bitreich.org 70
i@@ -238,7 +238,11 @@ main(int argc, char *argv[]) Err bitreich.org 70
i Err bitreich.org 70
i setlocale(LC_CTYPE, ""); Err bitreich.org 70
i Err bitreich.org 70
i+ /* do not search outside the git repository: Err bitreich.org 70
i+ GIT_CONFIG_LEVEL_APP is the highest level currently */ Err bitreich.org 70
i git_libgit2_init(); Err bitreich.org 70
i+ for (i = 1; i <= GIT_CONFIG_LEVEL_APP; i++) Err bitreich.org 70
i+ git_libgit2_opts(GIT_OPT_SET_SEARCH_PATH, i, ""); Err bitreich.org 70
i Err bitreich.org 70
i #ifdef __OpenBSD__ Err bitreich.org 70
i if (pledge("stdio rpath", NULL) == -1) Err bitreich.org 70
1diff --git a/stagit-gopher.c b/stagit-gopher.c /scm/stagit-gopher/file/stagit-gopher.c.gph bitreich.org 70
i@@ -1281,7 +1281,11 @@ main(int argc, char *argv[]) Err bitreich.org 70
i if (!realpath(repodir, repodirabs)) Err bitreich.org 70
i err(1, "realpath"); Err bitreich.org 70
i Err bitreich.org 70
i+ /* do not search outside the git repository: Err bitreich.org 70
i+ GIT_CONFIG_LEVEL_APP is the highest level currently */ Err bitreich.org 70
i git_libgit2_init(); Err bitreich.org 70
i+ for (i = 1; i <= GIT_CONFIG_LEVEL_APP; i++) Err bitreich.org 70
i+ git_libgit2_opts(GIT_OPT_SET_SEARCH_PATH, i, ""); Err bitreich.org 70
i Err bitreich.org 70
i #ifdef __OpenBSD__ Err bitreich.org 70
i if (unveil(repodir, "r") == -1) Err bitreich.org 70
.
Response:
text/plain