remove unused second parameter from gw_apply_unveil()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
diff --git a/gotweb/gotweb.c b/gotweb/gotweb.c
index 0ec2613..137f85d 100644
--- a/gotweb/gotweb.c
+++ b/gotweb/gotweb.c
@@ -206,7 +206,7 @@ static const struct got_error *gw_get_commits(struct gw_trans *,
struct gw_header *, int);
static const struct got_error *gw_get_commit(struct gw_trans *,
struct gw_header *);
-static const struct got_error *gw_apply_unveil(const char *, const char *);
+static const struct got_error *gw_apply_unveil(const char *);
static const struct got_error *gw_blame_cb(void *, int, int,
struct got_object_id *);
static const struct got_error *gw_load_got_paths(struct gw_trans *);
@@ -285,18 +285,10 @@ gw_kcgi_error(enum kcgi_err kerr)
}
static const struct got_error *
-gw_apply_unveil(const char *repo_path, const char *repo_file)
+gw_apply_unveil(const char *repo_path)
{
const struct got_error *err;
- if (repo_path && repo_file) {
- char *full_path;
- if (asprintf(&full_path, "%s/%s", repo_path, repo_file) == -1)
- return got_error_from_errno("asprintf unveil");
- if (unveil(full_path, "r") != 0)
- return got_error_from_errno2("unveil", full_path);
- }
-
if (repo_path && unveil(repo_path, "r") != 0)
return got_error_from_errno2("unveil", repo_path);
@@ -353,7 +345,7 @@ gw_blame(struct gw_trans *gw_trans)
if ((header = gw_init_header()) == NULL)
return got_error_from_errno("malloc");
- error = gw_apply_unveil(gw_trans->gw_dir->path, NULL);
+ error = gw_apply_unveil(gw_trans->gw_dir->path);
if (error)
goto done;
@@ -419,7 +411,7 @@ gw_blob(struct gw_trans *gw_trans)
if ((header = gw_init_header()) == NULL)
return got_error_from_errno("malloc");
- error = gw_apply_unveil(gw_trans->gw_dir->path, NULL);
+ error = gw_apply_unveil(gw_trans->gw_dir->path);
if (error)
goto done;
@@ -449,7 +441,7 @@ gw_diff(struct gw_trans *gw_trans)
if ((header = gw_init_header()) == NULL)
return got_error_from_errno("malloc");
- error = gw_apply_unveil(gw_trans->gw_dir->path, NULL);
+ error = gw_apply_unveil(gw_trans->gw_dir->path);
if (error)
goto done;
@@ -537,7 +529,7 @@ gw_index(struct gw_trans *gw_trans)
return error;
}
- error = gw_apply_unveil(gw_trans->gw_conf->got_repos_path, NULL);
+ error = gw_apply_unveil(gw_trans->gw_conf->got_repos_path);
if (error)
return error;
@@ -918,7 +910,7 @@ gw_commits(struct gw_trans *gw_trans)
goto done;
}
- error = gw_apply_unveil(gw_trans->gw_dir->path, NULL);
+ error = gw_apply_unveil(gw_trans->gw_dir->path);
if (error)
goto done;
@@ -1060,7 +1052,7 @@ gw_briefs(struct gw_trans *gw_trans)
goto done;
}
- error = gw_apply_unveil(gw_trans->gw_dir->path, NULL);
+ error = gw_apply_unveil(gw_trans->gw_dir->path);
if (error)
goto done;
@@ -1380,7 +1372,7 @@ gw_tree(struct gw_trans *gw_trans)
if ((header = gw_init_header()) == NULL)
return got_error_from_errno("malloc");
- error = gw_apply_unveil(gw_trans->gw_dir->path, NULL);
+ error = gw_apply_unveil(gw_trans->gw_dir->path);
if (error)
goto done;
@@ -1455,7 +1447,7 @@ gw_tag(struct gw_trans *gw_trans)
if ((header = gw_init_header()) == NULL)
return got_error_from_errno("malloc");
- error = gw_apply_unveil(gw_trans->gw_dir->path, NULL);
+ error = gw_apply_unveil(gw_trans->gw_dir->path);
if (error)
goto done;