diff options
author | Dmitry Kozlov <xeb@mail.ru> | 2016-04-02 20:25:13 +0300 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2016-04-02 20:25:13 +0300 |
commit | 7def2aa4a0af5eb26fc290257585a8c2901c0c3c (patch) | |
tree | 5aa0750758e7d48865d3c017db2a107a35baf440 /accel-pppd/session.c | |
parent | 60a945d8f075a5b90882455fa50678e2888b1d0f (diff) | |
download | accel-ppp-7def2aa4a0af5eb26fc290257585a8c2901c0c3c.tar.gz accel-ppp-7def2aa4a0af5eb26fc290257585a8c2901c0c3c.zip |
for single-session=deny make early check for duplicate username (before calling radius)
Diffstat (limited to 'accel-pppd/session.c')
-rw-r--r-- | accel-pppd/session.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/accel-pppd/session.c b/accel-pppd/session.c index 1fbac101..ad164f3f 100644 --- a/accel-pppd/session.c +++ b/accel-pppd/session.c @@ -428,6 +428,26 @@ int __export ap_session_set_username(struct ap_session *s, char *username) return 0; } +int __export ap_check_username(const char *username) +{ + struct ap_session *ses; + int r = 0; + + if (conf_single_session) + return 0; + + pthread_rwlock_rdlock(&ses_lock); + list_for_each_entry(ses, &ses_list, entry) { + if (ses->username && !strcmp(ses->username, username)) { + r = 1; + break; + } + } + pthread_rwlock_unlock(&ses_lock); + + return r; +} + static void save_seq(void) { FILE *f; |