summaryrefslogtreecommitdiffstats
path: root/src/authz.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/authz.h')
-rw-r--r--src/authz.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/authz.h b/src/authz.h
index 9ca0eb6..53f251d 100644
--- a/src/authz.h
+++ b/src/authz.h
@@ -56,6 +56,7 @@ typedef struct {
int errors;
int warnings;
+ int unreadable; /* the file itself could not be opened */
char *path; /* what messages call the file */
} policy_t;
@@ -178,10 +179,16 @@ typedef struct {
const char *out; /* NULL edits in place; "-" is stdout */
} edit_opts;
-/* Shared by the three editing commands: leading --out/--stdout flags, and how
- * many arguments they consumed. Returns -1 on an unknown option. */
+/* Shared by the three editing commands: pulls --out and --stdout out of the
+ * argument list wherever they sit (an option at the end reads better in a
+ * shell history) and compacts what is left into argv, returning the count in
+ * *consumed. Returns -1 on a missing value. */
int authz_parse_out(int argc, char **argv, edit_opts *o, int *consumed);
+/* A ref pattern or name that starts with "--" is a mistyped option, not
+ * something to grant. Prints and returns 1 when it finds one. */
+int authz_reject_options(int argc, char **argv);
+
int cmd_grant(const char *path, edit_opts o, int argc, char **argv);
int cmd_revoke(const char *path, edit_opts o, int argc, char **argv);
int cmd_protect(const char *path, edit_opts o, int argc, char **argv);