commit - ff08dcd6c83d27f29c7eb78f7b21fee64bebfdd2
commit + 1fa0d17d767f8e443af3b4493f3f2af0e759dda9
blob - 2c1701bd7583e22c83fc62c3bfca5fb2a5492585
blob + 13ec30c7bbebf2a4b0790af81d13d6db8545e79f
--- got/got.c
+++ got/got.c
int *pack_fds = NULL;
TAILQ_INIT(&ignores);
+
+#ifndef PROFILE
+ if (pledge("stdio rpath wpath cpath fattr flock proc exec sendfd "
+ "unveil",
+ NULL) == -1)
+ err(1, "pledge");
+#endif
while ((ch = getopt(argc, argv, "b:I:m:r:")) != -1) {
switch (ch) {
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_import();
int *pack_fds = NULL;
TAILQ_INIT(&paths);
+
+#ifndef PROFILE
+ if (pledge("stdio rpath wpath cpath fattr flock proc exec sendfd "
+ "unveil", NULL) == -1)
+ err(1, "pledge");
+#endif
while ((ch = getopt(argc, argv, "b:c:Ep:q")) != -1) {
switch (ch) {
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) {
char *base, *dotgit;
const char *path;
int *pack_fds = NULL;
TAILQ_INIT(&paths);
+
+#ifndef PROFILE
+ if (pledge("stdio rpath wpath cpath fattr flock proc exec sendfd "
+ "unveil", NULL) == -1)
+ err(1, "pledge");
+#endif
while ((ch = getopt(argc, argv, "b:c:q")) != -1) {
switch (ch) {
argc -= optind;
argv += optind;
-#ifndef PROFILE
- if (pledge("stdio rpath wpath cpath fattr flock proc exec sendfd "
- "unveil", NULL) == -1)
- err(1, "pledge");
-#endif
worktree_path = getcwd(NULL, 0);
if (worktree_path == NULL) {
error = got_error_from_errno("getcwd");
st.status_codes = NULL;
st.suppress = 0;
+#ifndef PROFILE
+ if (pledge("stdio rpath wpath cpath flock proc exec sendfd unveil",
+ NULL) == -1)
+ err(1, "pledge");
+#endif
+
while ((ch = getopt(argc, argv, "IS:s:")) != -1) {
switch (ch) {
case 'I':
argc -= optind;
argv += optind;
-#ifndef PROFILE
- if (pledge("stdio rpath wpath cpath flock proc exec sendfd unveil",
- NULL) == -1)
- err(1, "pledge");
-#endif
cwd = getcwd(NULL, 0);
if (cwd == NULL) {
error = got_error_from_errno("getcwd");
char *refname = NULL;
int *pack_fds = NULL;
+#ifndef PROFILE
+ if (pledge("stdio rpath wpath cpath fattr flock proc exec "
+ "sendfd unveil", NULL) == -1)
+ err(1, "pledge");
+#endif
+
while ((ch = getopt(argc, argv, "c:dlr:s:t")) != -1) {
switch (ch) {
case 'c':
if (refname)
got_path_strip_trailing_slashes(refname);
-#ifndef PROFILE
- 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) {
error = got_error_from_errno("getcwd");
TAILQ_INIT(&paths);
+#ifndef PROFILE
+ if (pledge("stdio rpath wpath cpath fattr flock proc exec "
+ "sendfd unveil", NULL) == -1)
+ err(1, "pledge");
+#endif
+
while ((ch = getopt(argc, argv, "c:d:lnr:t")) != -1) {
switch (ch) {
case 'c':
} else if (!do_show && argc != 1)
usage_branch();
-#ifndef PROFILE
- 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) {
error = got_error_from_errno("getcwd");
const char *tag_name = NULL, *commit_id_arg = NULL, *tagmsg = NULL;
int ch, do_list = 0, verify_tags = 0, verbosity = 0;
int *pack_fds = NULL;
+
+#ifndef PROFILE
+ if (pledge("stdio rpath wpath cpath fattr flock proc exec "
+ "sendfd unveil", NULL) == -1)
+ err(1, "pledge");
+#endif
while ((ch = getopt(argc, argv, "c:lm:r:s:Vv")) != -1) {
switch (ch) {
if (argc == 1)
tag_name = argv[0];
-#ifndef PROFILE
- 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) {
error = got_error_from_errno("getcwd");
TAILQ_INIT(&paths);
+#ifndef PROFILE
+ if (pledge("stdio rpath wpath cpath flock proc exec sendfd unveil",
+ NULL) == -1)
+ err(1, "pledge");
+#endif
+
while ((ch = getopt(argc, argv, "IR")) != -1) {
switch (ch) {
case 'I':
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();
TAILQ_INIT(&paths);
+#ifndef PROFILE
+ if (pledge("stdio rpath wpath cpath flock proc exec sendfd unveil",
+ NULL) == -1)
+ err(1, "pledge");
+#endif
+
while ((ch = getopt(argc, argv, "fkRs:")) != -1) {
switch (ch) {
case 'f':
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();
TAILQ_INIT(&paths);
+#ifndef PROFILE
+ if (pledge("stdio rpath wpath cpath fattr flock proc exec sendfd "
+ "unveil", NULL) == -1)
+ err(1, "pledge");
+#endif
+
while ((ch = getopt(argc, argv, "F:pR")) != -1) {
switch (ch) {
case 'F':
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();
if (patch_script_path && !pflag)
TAILQ_INIT(&paths);
cl_arg.logmsg_path = NULL;
+#ifndef PROFILE
+ if (pledge("stdio rpath wpath cpath fattr flock proc exec sendfd "
+ "unveil", NULL) == -1)
+ err(1, "pledge");
+#endif
+
while ((ch = getopt(argc, argv, "A:F:m:NnS")) != -1) {
switch (ch) {
case 'A':
argc -= optind;
argv += optind;
-#ifndef PROFILE
- 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) {
error = got_error_from_errno("getcwd");
int ch, list_refs = 0, remove_refs = 0;
struct got_update_progress_arg upa;
int *pack_fds = NULL;
+
+#ifndef PROFILE
+ if (pledge("stdio rpath wpath cpath fattr flock proc exec sendfd "
+ "unveil", NULL) == -1)
+ err(1, "pledge");
+#endif
while ((ch = getopt(argc, argv, "lX")) != -1) {
switch (ch) {
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 (list_refs || remove_refs) {
if (argc != 0 && argc != 1)
usage_cherrypick();
int ch, list_refs = 0, remove_refs = 0;
struct got_update_progress_arg upa;
int *pack_fds = NULL;
+
+#ifndef PROFILE
+ if (pledge("stdio rpath wpath cpath fattr flock proc exec sendfd "
+ "unveil", NULL) == -1)
+ err(1, "pledge");
+#endif
while ((ch = getopt(argc, argv, "lX")) != -1) {
switch (ch) {
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 (list_refs || remove_refs) {
if (argc != 0 && argc != 1)
usage_backout();
STAILQ_INIT(&commits);
TAILQ_INIT(&merged_paths);
memset(&upa, 0, sizeof(upa));
+
+#ifndef PROFILE
+ if (pledge("stdio rpath wpath cpath fattr flock proc exec sendfd "
+ "unveil", NULL) == -1)
+ err(1, "pledge");
+#endif
while ((ch = getopt(argc, argv, "aclX")) != -1) {
switch (ch) {
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 (list_backups) {
if (abort_rebase)
option_conflict('l', 'a');
TAILQ_INIT(&merged_paths);
memset(&upa, 0, sizeof(upa));
+#ifndef PROFILE
+ if (pledge("stdio rpath wpath cpath fattr flock proc exec sendfd "
+ "unveil", NULL) == -1)
+ err(1, "pledge");
+#endif
+
while ((ch = getopt(argc, argv, "acdeF:flmX")) != -1) {
switch (ch) {
case 'a':
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_edit && continue_edit)
option_conflict('a', 'c');
if (edit_script_path && edit_logmsg_only)
int ch;
struct got_update_progress_arg upa;
int *pack_fds = NULL;
+
+#ifndef PROFILE
+ if (pledge("stdio rpath wpath cpath fattr flock proc exec sendfd "
+ "unveil", NULL) == -1)
+ err(1, "pledge");
+#endif
while ((ch = getopt(argc, argv, "")) != -1) {
switch (ch) {
if (argc != 1)
usage_integrate();
branch_arg = argv[0];
-#ifndef PROFILE
- 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) {
error = got_error_from_errno("getcwd");
int *pack_fds = NULL;
memset(&upa, 0, sizeof(upa));
+
+#ifndef PROFILE
+ if (pledge("stdio rpath wpath cpath fattr flock proc exec sendfd "
+ "unveil", NULL) == -1)
+ err(1, "pledge");
+#endif
while ((ch = getopt(argc, argv, "acn")) != -1) {
switch (ch) {
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_merge && continue_merge)
option_conflict('a', 'c');
if (abort_merge || continue_merge) {
TAILQ_INIT(&paths);
+#ifndef PROFILE
+ if (pledge("stdio rpath wpath cpath fattr flock proc exec sendfd "
+ "unveil", NULL) == -1)
+ err(1, "pledge");
+#endif
+
while ((ch = getopt(argc, argv, "F:lpS")) != -1) {
switch (ch) {
case 'F':
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 (list_stage && (pflag || patch_script_path))
errx(1, "-l option cannot be used with other options");
if (patch_script_path && !pflag)
TAILQ_INIT(&paths);
+#ifndef PROFILE
+ if (pledge("stdio rpath wpath cpath fattr flock proc exec sendfd "
+ "unveil", NULL) == -1)
+ err(1, "pledge");
+#endif
+
while ((ch = getopt(argc, argv, "F:p")) != -1) {
switch (ch) {
case 'F':
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 (patch_script_path && !pflag)
errx(1, "-F option can only be used together with -p option");
TAILQ_INIT(&paths);
+#ifndef PROFILE
+ if (pledge("stdio rpath wpath cpath flock proc exec sendfd unveil",
+ NULL) == -1)
+ err(1, "pledge");
+#endif
+
while ((ch = getopt(argc, argv, "")) != -1) {
switch (ch) {
default:
argc -= optind;
argv += optind;
-#ifndef PROFILE
- if (pledge("stdio rpath wpath cpath flock proc exec sendfd unveil",
- NULL) == -1)
- err(1, "pledge");
-#endif
cwd = getcwd(NULL, 0);
if (cwd == NULL) {
error = got_error_from_errno("getcwd");
blob - e67fbcf1e5c4b6bc2399bde36796bf77749c9bed
blob + 158bbdc93cdc3b2264d3efa8d639edde028f21d8
--- gotadmin/gotadmin.c
+++ gotadmin/gotadmin.c
const char *head_name = NULL;
char *repo_path = NULL;
int ch;
+
+#ifndef PROFILE
+ if (pledge("stdio rpath wpath cpath unveil", NULL) == -1)
+ err(1, "pledge");
+#endif
while ((ch = getopt(argc, argv, "b:")) != -1) {
switch (ch) {
argc -= optind;
argv += optind;
-#ifndef PROFILE
- if (pledge("stdio rpath wpath cpath unveil", NULL) == -1)
- err(1, "pledge");
-#endif
if (argc != 1)
usage_init();
off_t packsize, loose_size;
char scaled[FMT_SCALED_STRSIZE];
int *pack_fds = NULL;
+
+#ifndef PROFILE
+ if (pledge("stdio rpath wpath cpath flock proc exec sendfd unveil",
+ NULL) == -1)
+ err(1, "pledge");
+#endif
while ((ch = getopt(argc, argv, "r:")) != -1) {
switch (ch) {
argc -= optind;
argv += optind;
-#ifndef PROFILE
- if (pledge("stdio rpath wpath cpath flock proc exec sendfd unveil",
- NULL) == -1)
- err(1, "pledge");
-#endif
if (repo_path == NULL) {
error = get_repo_path(&repo_path);
if (error)
TAILQ_INIT(&exclude_refs);
TAILQ_INIT(&include_refs);
+#ifndef PROFILE
+ if (pledge("stdio rpath wpath cpath fattr flock proc exec sendfd unveil",
+ NULL) == -1)
+ err(1, "pledge");
+#endif
+
while ((ch = getopt(argc, argv, "aqr:x:")) != -1) {
switch (ch) {
case 'a':
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 (repo_path == NULL) {
error = get_repo_path(&repo_path);
if (error)
int show_stats = 0, human_readable = 0;
int *pack_fds = NULL;
+#ifndef PROFILE
+ if (pledge("stdio rpath wpath cpath flock proc exec sendfd unveil",
+ NULL) == -1)
+ err(1, "pledge");
+#endif
+
while ((ch = getopt(argc, argv, "hs")) != -1) {
switch (ch) {
case 'h':
if (packfile_path == NULL)
return got_error_from_errno2("realpath", argv[0]);
-#ifndef PROFILE
- if (pledge("stdio rpath wpath cpath flock proc exec sendfd unveil",
- NULL) == -1)
- err(1, "pledge");
-#endif
error = got_repo_pack_fds_open(&pack_fds);
if (error != NULL)
goto done;
char scaled_after[FMT_SCALED_STRSIZE];
char scaled_diff[FMT_SCALED_STRSIZE];
int *pack_fds = NULL;
+
+#ifndef PROFILE
+ if (pledge("stdio rpath wpath cpath flock proc exec sendfd unveil",
+ NULL) == -1)
+ err(1, "pledge");
+#endif
while ((ch = getopt(argc, argv, "anpqr:")) != -1) {
switch (ch) {
argc -= optind;
argv += optind;
-#ifndef PROFILE
- if (pledge("stdio rpath wpath cpath flock proc exec sendfd unveil",
- NULL) == -1)
- err(1, "pledge");
-#endif
if (repo_path == NULL) {
error = get_repo_path(&repo_path);
if (error)
blob - 59f6749677b14d49ad79028572ac387a766ff9db
blob + 0d706f1c0a5161fd7a132b213b89c64e4cd17da0
--- tog/tog.c
+++ tog/tog.c
{ NULL, 0, NULL, 0}
};
char *diff_algo_str = NULL;
+
+ setlocale(LC_CTYPE, "");
+
+#ifndef PROFILE
+ if (pledge("stdio rpath wpath cpath flock proc tty exec sendfd unveil",
+ NULL) == -1)
+ err(1, "pledge");
+#endif
if (!isatty(STDIN_FILENO))
errx(1, "standard input is not a tty");
- setlocale(LC_CTYPE, "");
-
while ((ch = getopt_long(argc, argv, "+hV", longopts, NULL)) != -1) {
switch (ch) {
case 'h':
return 0;
}
-#ifndef PROFILE
- if (pledge("stdio rpath wpath cpath flock proc tty exec sendfd unveil",
- NULL) == -1)
- err(1, "pledge");
-#endif
-
if (argc == 0) {
if (hflag)
usage(hflag, 0);