summaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/main.c b/src/main.c
index 368751b..8a42b72 100644
--- a/src/main.c
+++ b/src/main.c
@@ -3,7 +3,7 @@
* check an operator asking, or a script
* authorize git asking, once per push (also reached as 'pre-receive')
* validate the entrypoint and CI asking before anything is served
- * edit changing the file (grant, revoke, protect)
+ * edit changing the file (grant, revoke)
*
* They are one program because they must agree, exactly, about what a rule
* means: a check that answers differently from the hook is worse than two
@@ -58,14 +58,14 @@ static void usage(FILE *f)
"\n"
" grant <user> <repo> <level> [ref ...] add one rule, or replace that pair's\n"
" revoke <user> <repo> take it away again\n"
-" protect [--repo R] <ref pattern> ... set which refs need an extra level\n"
" --out FILE | --stdout write elsewhere instead of in place\n"
" The deployed policy is a read-only mount on purpose; these are for the\n"
" source copy, and they say so when they are pointed at a read-only file.\n"
"\n"
"Levels are monotone: admin implies force implies write. '@all' means everyone\n"
"the policy already names. \"main\", \"heads/main\" and \"refs/heads/main\" are the\n"
-"same branch; a bare name is always a branch and never a tag.\n"
+"same branch; a bare name is always a branch and never a tag. A rule says what\n"
+"it says: nothing else in the file can raise the price of a ref.\n"
"\n"
"Exit status: 0 allowed, 1 denied, 3 the policy could not be read or does not\n"
"parse - nothing is allowed on a policy that cannot be read - and 64 for usage.\n",
@@ -274,8 +274,7 @@ int main(int argc, char **argv)
/* The three commands that change the file. They read it themselves, and
* they must not disagree with the checker about what a rule means, which is
* why they are in the same binary. */
- if (strcmp(cmd, "grant") == 0 || strcmp(cmd, "revoke") == 0 ||
- strcmp(cmd, "protect") == 0) {
+ if (strcmp(cmd, "grant") == 0 || strcmp(cmd, "revoke") == 0) {
int consumed = 0;
if (authz_parse_out(argc, argv, &eo, &consumed) != 0)
@@ -283,9 +282,7 @@ int main(int argc, char **argv)
argc -= consumed; /* what is left was compacted to the front */
if (strcmp(cmd, "grant") == 0)
return cmd_grant(path, eo, argc, argv);
- if (strcmp(cmd, "revoke") == 0)
- return cmd_revoke(path, eo, argc, argv);
- return cmd_protect(path, eo, argc, argv);
+ return cmd_revoke(path, eo, argc, argv);
}
policy_init(&p, path);