summaryrefslogtreecommitdiff
path: root/accel-pppd/auth/auth_mschap_v1.c
diff options
context:
space:
mode:
authorKozlov Dmitry <xeb@mail.ru>2011-09-20 11:06:54 +0400
committerKozlov Dmitry <xeb@mail.ru>2011-09-20 11:06:54 +0400
commit19ac6b6c05c863136855c5577ee3b6e493c499a5 (patch)
treecaeda3536d25a046cabfc772ff7f59ec3a0410bf /accel-pppd/auth/auth_mschap_v1.c
parent609af350ace3c284af7bec0b5c27c59a8eff4b8c (diff)
downloadaccel-ppp-xebd-19ac6b6c05c863136855c5577ee3b6e493c499a5.tar.gz
accel-ppp-xebd-19ac6b6c05c863136855c5577ee3b6e493c499a5.zip
auth: config reload
Diffstat (limited to 'accel-pppd/auth/auth_mschap_v1.c')
-rw-r--r--accel-pppd/auth/auth_mschap_v1.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/accel-pppd/auth/auth_mschap_v1.c b/accel-pppd/auth/auth_mschap_v1.c
index b212f03..2d33252 100644
--- a/accel-pppd/auth/auth_mschap_v1.c
+++ b/accel-pppd/auth/auth_mschap_v1.c
@@ -481,9 +481,9 @@ static void chap_recv(struct ppp_handler_t *h)
log_ppp_warn("mschap-v1: unknown code received %x\n", hdr->code);
}
-static void auth_mschap_v1_init()
+static void load_config(void)
{
- char *opt;
+ const char *opt;
opt = conf_get_opt("auth", "timeout");
if (opt && atoi(opt) > 0)
@@ -498,16 +498,24 @@ static void auth_mschap_v1_init()
conf_max_failure = atoi(opt);
opt = conf_get_opt("auth", "any-login");
- if (opt && atoi(opt) > 0)
- conf_any_login = 1;
+ if (opt)
+ conf_any_login = atoi(opt);
+}
+static void auth_mschap_v1_init()
+{
urandom_fd = open("/dev/urandom", O_RDONLY);
if (urandom_fd < 0) {
log_emerg("mschap-v1: failed to open /dev/urandom: %s\n", strerror(errno));
return;
}
+
+ load_config();
+
if (ppp_auth_register_handler(&chap))
log_emerg("mschap-v1: failed to register handler\n");
+
+ triton_event_register_handler(EV_CONFIG_RELOAD, (triton_event_func)load_config);
}
DEFINE_INIT(5, auth_mschap_v1_init);