commit 43012d5817071b74fc38aef617a3eb8f2da4a945 from: Stefan Sperling date: Sun Jul 14 16:12:39 2019 UTC oops; several got commands were missing their pledge(2) calls commit - 172011266998fb86e8c844c279e246f54b6981e1 commit + 43012d5817071b74fc38aef617a3eb8f2da4a945 blob - f1cf05099aba625e95492a9375bc08baa4bf08fc blob + 0bfd597accf4b09dfa3552fc715ec1c20c3108b7 --- got/got.c +++ got/got.c @@ -2493,6 +2493,11 @@ cmd_add(int argc, char *argv[]) argc -= optind; argv += optind; +#ifndef PROFILE + if (pledge("stdio rpath wpath cpath flock proc exec sendfd unveil", + NULL) == -1) + err(1, "pledge"); +#endif if (argc < 1) usage_add(); @@ -2587,6 +2592,11 @@ cmd_remove(int argc, char *argv[]) argc -= optind; argv += optind; +#ifndef PROFILE + if (pledge("stdio rpath wpath cpath flock proc exec sendfd unveil", + NULL) == -1) + err(1, "pledge"); +#endif if (argc < 1) usage_remove(); @@ -2688,6 +2698,11 @@ cmd_revert(int argc, char *argv[]) argc -= optind; argv += optind; +#ifndef PROFILE + if (pledge("stdio rpath wpath cpath fattr flock proc exec sendfd " + "unveil", NULL) == -1) + err(1, "pledge"); +#endif if (argc < 1) usage_revert(); @@ -2935,6 +2950,11 @@ cmd_commit(int argc, char *argv[]) argc -= optind; argv += optind; +#ifndef PROFILE + if (pledge("stdio rpath wpath cpath fattr flock proc exec sendfd " + "unveil", NULL) == -1) + err(1, "pledge"); +#endif if (argc == 1) { path = realpath(argv[0], NULL); if (path == NULL) { @@ -3053,6 +3073,11 @@ cmd_cherrypick(int argc, char *argv[]) argc -= optind; argv += optind; +#ifndef PROFILE + if (pledge("stdio rpath wpath cpath fattr flock proc exec sendfd " + "unveil", NULL) == -1) + err(1, "pledge"); +#endif if (argc != 1) usage_cherrypick(); @@ -3163,6 +3188,11 @@ cmd_backout(int argc, char *argv[]) argc -= optind; argv += optind; +#ifndef PROFILE + if (pledge("stdio rpath wpath cpath fattr flock proc exec sendfd " + "unveil", NULL) == -1) + err(1, "pledge"); +#endif if (argc != 1) usage_backout(); @@ -3458,6 +3488,11 @@ cmd_rebase(int argc, char *argv[]) argc -= optind; argv += optind; +#ifndef PROFILE + if (pledge("stdio rpath wpath cpath fattr flock proc exec sendfd " + "unveil", NULL) == -1) + err(1, "pledge"); +#endif if (abort_rebase && continue_rebase) usage_rebase(); else if (abort_rebase || continue_rebase) {