Commit e0b573502e97109a2383ba55a08e39d0b1891d7f

Stefan Sperling 2019-03-12T11:56:50

'got ref -l' can do without cpath and fattr pledges

diff --git a/got/got.c b/got/got.c
index 38d5762..bae0368 100644
--- a/got/got.c
+++ b/got/got.c
@@ -1792,9 +1792,15 @@ cmd_ref(int argc, char *argv[])
 		usage_ref();
 
 #ifndef PROFILE
-	if (pledge("stdio rpath wpath cpath fattr flock proc exec sendfd "
-	    "unveil", NULL) == -1)
-		err(1, "pledge");
+	if (do_list) {
+		if (pledge("stdio rpath wpath flock proc exec sendfd unveil",
+		    NULL) == -1)
+			err(1, "pledge");
+	} else {
+		if (pledge("stdio rpath wpath cpath fattr flock proc exec "
+		    "sendfd unveil", NULL) == -1)
+			err(1, "pledge");
+	}
 #endif
 	cwd = getcwd(NULL, 0);
 	if (cwd == NULL) {