summaryrefslogtreecommitdiff
path: root/accel-pptpd/pwdb.c
diff options
context:
space:
mode:
authorKozlov Dmitry <dima@server>2010-09-06 18:27:02 +0400
committerKozlov Dmitry <dima@server>2010-09-06 18:27:02 +0400
commit45243dd2f2be49cd91be1dc28932e6c9040db6a1 (patch)
tree652896ecd889d58d4a3c9d3232c85ff831b31699 /accel-pptpd/pwdb.c
parentaf5a96e2d04056b065a36ecbd140a16d0685c7e6 (diff)
downloadaccel-ppp-45243dd2f2be49cd91be1dc28932e6c9040db6a1.tar.gz
accel-ppp-45243dd2f2be49cd91be1dc28932e6c9040db6a1.zip
working on radius module
Diffstat (limited to 'accel-pptpd/pwdb.c')
-rw-r--r--accel-pptpd/pwdb.c31
1 files changed, 8 insertions, 23 deletions
diff --git a/accel-pptpd/pwdb.c b/accel-pptpd/pwdb.c
index 8bde8ff..1b682a4 100644
--- a/accel-pptpd/pwdb.c
+++ b/accel-pptpd/pwdb.c
@@ -6,41 +6,26 @@
static LIST_HEAD(pwdb_handlers);
-int __export pwdb_cleartext_check(struct ppp_t *ppp, const char *username,const char *password)
+int __export pwdb_check(struct ppp_t *ppp, const char *username, int type, ...)
{
struct pwdb_t *pwdb;
- int r = PWDB_NO_IMPL;
-
- list_for_each_entry(pwdb, &pwdb_handlers, entry) {
- if (!pwdb->cleartext_check)
- continue;
- r = pwdb->cleartext_check(pwdb, ppp, username, password);
- if (r == PWDB_NO_IMPL)
- continue;
- break;
- }
-
- return r;
-}
-int __export pwdb_encrypted_check(struct ppp_t *ppp, const char *username, int type, ...)
-{
- struct pwdb_t *pwdb;
- int r = PWDB_NO_IMPL;
+ int r, res = PWDB_NO_IMPL;
va_list args;
va_start(args, type);
list_for_each_entry(pwdb, &pwdb_handlers, entry) {
- if (!pwdb->encrypted_check)
+ if (!pwdb->check)
continue;
- r = pwdb->encrypted_check(pwdb, ppp, username, type, args);
+ r = pwdb->check(pwdb, ppp, username, type, args);
if (r == PWDB_NO_IMPL)
continue;
- break;
+ if (r == PWDB_SUCCESS)
+ return PWDB_SUCCESS;
+ res = r;
}
- return r;
-
+ return res;
}
__export const char *pwdb_get_passwd(struct ppp_t *ppp, const char *username)
{