summaryrefslogtreecommitdiffstats
path: root/nest/proto.c
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2010-02-21 09:57:26 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2010-02-21 09:57:26 +0100
commite0a45fb42163a6bfdeeee44bd0a6a7461552e10f (patch)
treed0c889a0b98ea7d269e44c1693d5a3fbb6322738 /nest/proto.c
parente304fd4bcf5813b581a39078a25a5cf6916b9f29 (diff)
downloadbird-e0a45fb42163a6bfdeeee44bd0a6a7461552e10f.tar
bird-e0a45fb42163a6bfdeeee44bd0a6a7461552e10f.zip
Restricted read-only CLI.
Also adds support for executing commands using birdc <cmd>.
Diffstat (limited to 'nest/proto.c')
-rw-r--r--nest/proto.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/nest/proto.c b/nest/proto.c
index 7c4d32d..e9cf3df 100644
--- a/nest/proto.c
+++ b/nest/proto.c
@@ -1006,8 +1006,12 @@ proto_apply_cmd_patt(char *patt, void (* cmd)(struct proto *, unsigned int, int)
}
void
-proto_apply_cmd(struct proto_spec ps, void (* cmd)(struct proto *, unsigned int, int), unsigned int arg)
+proto_apply_cmd(struct proto_spec ps, void (* cmd)(struct proto *, unsigned int, int),
+ int restricted, unsigned int arg)
{
+ if (restricted && cli_access_restricted())
+ return;
+
if (ps.patt)
proto_apply_cmd_patt(ps.ptr, cmd, arg);
else