Commit 36e2fb666259aadac2fb2c9399346aeeec2825b8

Stefan Sperling 2019-01-04T17:35:53

apply unveil(2) to 'got blame'

diff --git a/got/got.c b/got/got.c
index 2bf611f..2277622 100644
--- a/got/got.c
+++ b/got/got.c
@@ -985,8 +985,8 @@ cmd_blame(int argc, char *argv[])
 	int ch;
 
 #ifndef PROFILE
-	if (pledge("stdio rpath wpath cpath flock proc exec sendfd", NULL)
-	    == -1)
+	if (pledge("stdio rpath wpath cpath flock proc exec sendfd unveil",
+	    NULL) == -1)
 		err(1, "pledge");
 #endif
 
@@ -1027,6 +1027,10 @@ cmd_blame(int argc, char *argv[])
 		}
 	}
 
+	error = apply_unveil(repo_path, NULL);
+	if (error)
+		goto done;
+
 	error = got_repo_open(&repo, repo_path);
 	if (error != NULL)
 		goto done;