summaryrefslogtreecommitdiff
path: root/accel-pppd/ctrl
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2013-10-02 22:35:17 +0400
committerDmitry Kozlov <xeb@mail.ru>2013-10-02 22:35:17 +0400
commite461c5423384f21efdd1cfc8d57e2fd39f0d156e (patch)
tree8fc97d2f44dc9b6ff5e020f9c1d41a8dd5c7ce58 /accel-pppd/ctrl
parent6b442343da91747481c07f12584866ef34ed8917 (diff)
downloadaccel-ppp-e461c5423384f21efdd1cfc8d57e2fd39f0d156e.tar.gz
accel-ppp-e461c5423384f21efdd1cfc8d57e2fd39f0d156e.zip
ipoe: intoduced 'password' option to control password generation
Diffstat (limited to 'accel-pppd/ctrl')
-rw-r--r--accel-pppd/ctrl/ipoe/ipoe.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/accel-pppd/ctrl/ipoe/ipoe.c b/accel-pppd/ctrl/ipoe/ipoe.c
index ac1a68f..7059e2a 100644
--- a/accel-pppd/ctrl/ipoe/ipoe.c
+++ b/accel-pppd/ctrl/ipoe/ipoe.c
@@ -101,6 +101,7 @@ static uint32_t conf_src;
//static int conf_dhcpv6;
static int conf_username;
+static const char *conf_password;
static int conf_unit_cache;
static int conf_noauth;
#ifdef RADIUS
@@ -474,7 +475,7 @@ static void ipoe_session_start(struct ipoe_session *ses)
ap_session_starting(&ses->ses);
if (!conf_noauth) {
- r = pwdb_check(&ses->ses, ses->ses.username, PPP_PAP, ses->ses.username);
+ r = pwdb_check(&ses->ses, ses->ses.username, PPP_PAP, conf_password ? conf_password : ses->ses.username);
if (r == PWDB_NO_IMPL) {
passwd = pwdb_get_passwd(&ses->ses, ses->ses.username);
if (!passwd)
@@ -2690,6 +2691,17 @@ static void load_config(void)
log_emerg("ipoe: unknown username value '%s'\n", opt);
} else
conf_username = USERNAME_UNSET;
+
+ opt = conf_get_opt("ipoe", "password");
+ if (opt) {
+ if (!strcmp(opt, "username"))
+ conf_password = NULL;
+ else if (!strcmp(opt, "empty"))
+ conf_password = "";
+ else
+ conf_password = opt;
+ } else
+ conf_password = NULL;
opt = conf_get_opt("ipoe", "netmask");
if (opt) {