]> git.armaanb.net Git - stagit.git/blobdiff - stagit.c
add OpenBSD unveil support
[stagit.git] / stagit.c
index a6cfebc043b62d54695612a0482ff097a061fb2e..dcac01609fd98046eb1c3503f36f12a1f393a7da 100644 (file)
--- a/stagit.c
+++ b/stagit.c
@@ -1095,6 +1095,13 @@ main(int argc, char *argv[])
        git_libgit2_init();
 
 #ifdef __OpenBSD__
+       if (unveil(repodir, "r") == -1)
+               err(1, "unveil: %s", repodir);
+       if (unveil(".", "rwc") == -1)
+               err(1, "unveil: .");
+       if (cachefile && unveil(cachefile, "rwc") == -1)
+               err(1, "unveil: %s", cachefile);
+
        if (cachefile) {
                if (pledge("stdio rpath wpath cpath fattr", NULL) == -1)
                        err(1, "pledge");