commit - 11a2b20c6274fd87160362f39493d1b0b013e443
commit + a0abeae54173ae5718c4d39250ee22483512e59b
blob - 79910ef42000853ea31476a0e47ed20dbc3e848f
blob + 3e6557afb66d2dca86737356b79f02d52dfb7ea2
--- 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 - 52aa7491c5c27ef8be99eeaa1d4046e6b92610bf
blob + 3aaef3cd2dd0fdb5d027a580537a9676d65237a8
--- 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 - 150f3c355688b24c83a7a03a635b993f8f20f5a2
blob + c208567d258f17c2d797dd89d98c42d49fdb4d3b
--- 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);