diff options
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; |