Commit 8e94dd5baf6b3c0b02b5ca1cfacca1abeb4954c3

Stefan Sperling 2019-01-04T17:41:30

apply unveil(2) to 'tog blame'

diff --git a/tog/tog.c b/tog/tog.c
index 842187b..1154cf1 100644
--- a/tog/tog.c
+++ b/tog/tog.c
@@ -2805,8 +2805,8 @@ cmd_blame(int argc, char *argv[])
 	struct tog_view *view;
 
 #ifndef PROFILE
-	if (pledge("stdio rpath wpath cpath flock proc tty exec sendfd", NULL)
-	    == -1)
+	if (pledge("stdio rpath wpath cpath flock proc tty exec sendfd unveil",
+	    NULL) == -1)
 		err(1, "pledge");
 #endif
 
@@ -2847,6 +2847,9 @@ 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)