0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-11-09 12:48:43 +00:00

Allow submitting BIRD commands from UNIX shell even in restricted mode.

This commit is contained in:
Ondrej Filip 2013-02-12 13:15:01 +01:00
parent 8c4da7e01d
commit 4c2abee74e

View File

@ -29,6 +29,7 @@ static char *opt_list = "s:vr";
static int verbose; static int verbose;
static char *init_cmd; static char *init_cmd;
static int once; static int once;
static int restricted;
static char *server_path = PATH_CONTROL_SOCKET; static char *server_path = PATH_CONTROL_SOCKET;
static int server_fd; static int server_fd;
@ -70,7 +71,7 @@ parse_args(int argc, char **argv)
verbose++; verbose++;
break; break;
case 'r': case 'r':
init_cmd = "restrict"; restricted = 1;
break; break;
default: default:
usage(); usage();
@ -83,9 +84,6 @@ parse_args(int argc, char **argv)
int i; int i;
int len = 0; int len = 0;
if (init_cmd)
usage();
for (i = optind; i < argc; i++) for (i = optind; i < argc; i++)
len += strlen(argv[i]) + 1; len += strlen(argv[i]) + 1;
@ -303,6 +301,13 @@ update_state(void)
if (nstate == cstate) if (nstate == cstate)
return; return;
if (restricted)
{
submit_server_command("restrict");
restricted = 0;
return;
}
if (init_cmd) if (init_cmd)
{ {
/* First transition - client received hello from BIRD /* First transition - client received hello from BIRD