1
0
mirror of https://gitlab.labs.nic.cz/labs/bird.git synced 2024-05-11 16:54:54 +00:00

Restricted read-only CLI.

Also adds support for executing commands using birdc <cmd>.
This commit is contained in:
Ondrej Zajicek
2010-02-21 09:57:26 +01:00
parent e304fd4bcf
commit e0a45fb421
8 changed files with 91 additions and 17 deletions

View File

@@ -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