Commit Diff


commit - 8e94dd5baf6b3c0b02b5ca1cfacca1abeb4954c3
commit + d188b9a6a4bf15b68454c779d7bdfe1d76c8e90e
blob - 1154cf1290a9890041639576f70f2b42741a84e3
blob + 0d1a9578607f40f7f624bbe3e4ff2c0eac11597f
--- tog/tog.c
+++ tog/tog.c
@@ -3415,8 +3415,8 @@ cmd_tree(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
 
@@ -3445,6 +3445,10 @@ cmd_tree(int argc, char *argv[])
 	} else
 		usage_log();
 
+	error = apply_unveil(repo_path, NULL);
+	if (error)
+		return error;
+
 	error = got_repo_open(&repo, repo_path);
 	free(repo_path);
 	if (error != NULL)