mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-12-22 09:41:54 +00:00
Fixed a stupid bug in parse-and-exit mode
Introduced in 08ff0af898
, the additional CLI
configuration wasn't properly initialized in the parse-and-exit mode
due to an oversight that cli_init_unix() is not called in this mode.
Thanks to Felix Friedlander for the bugreport.
This commit is contained in:
parent
404e82616d
commit
2ba6e797cc
@ -599,7 +599,6 @@ static void
|
|||||||
cli_init_unix(uid_t use_uid, gid_t use_gid)
|
cli_init_unix(uid_t use_uid, gid_t use_gid)
|
||||||
{
|
{
|
||||||
ASSERT_DIE(main_control_socket_config == NULL);
|
ASSERT_DIE(main_control_socket_config == NULL);
|
||||||
cli_init();
|
|
||||||
|
|
||||||
main_control_socket_config = &initial_control_socket_config;
|
main_control_socket_config = &initial_control_socket_config;
|
||||||
main_control_socket_config->uid = use_uid;
|
main_control_socket_config->uid = use_uid;
|
||||||
@ -614,6 +613,9 @@ cli_init_unix(uid_t use_uid, gid_t use_gid)
|
|||||||
static void
|
static void
|
||||||
cli_preconfig(struct config *c)
|
cli_preconfig(struct config *c)
|
||||||
{
|
{
|
||||||
|
if (!main_control_socket_config)
|
||||||
|
return;
|
||||||
|
|
||||||
struct cli_config *ccf = mb_alloc(cli_pool, sizeof *ccf);
|
struct cli_config *ccf = mb_alloc(cli_pool, sizeof *ccf);
|
||||||
memcpy(ccf, main_control_socket_config, sizeof *ccf);
|
memcpy(ccf, main_control_socket_config, sizeof *ccf);
|
||||||
ccf->n = (struct cli_config_node) {};
|
ccf->n = (struct cli_config_node) {};
|
||||||
@ -1011,6 +1013,8 @@ main(int argc, char **argv)
|
|||||||
uid_t use_uid = get_uid(use_user);
|
uid_t use_uid = get_uid(use_user);
|
||||||
gid_t use_gid = get_gid(use_group);
|
gid_t use_gid = get_gid(use_group);
|
||||||
|
|
||||||
|
cli_init();
|
||||||
|
|
||||||
if (!parse_and_exit)
|
if (!parse_and_exit)
|
||||||
{
|
{
|
||||||
test_old_bird(path_control_socket);
|
test_old_bird(path_control_socket);
|
||||||
|
Loading…
Reference in New Issue
Block a user