From d788bc2354bba5f18f5bbbe7019520e11feb310f Mon Sep 17 00:00:00 2001 From: Maxim Mamontov Date: Sat, 18 Dec 2010 16:02:37 +0200 Subject: [PATCH] =?utf8?q?=D0=A7=D0=B8=D1=81=D1=82=D0=BA=D0=B0=20=D0=BA?= =?utf8?q?=D0=BE=D0=B4=D0=B0=20=D0=BC=D0=BE=D0=B4=D1=83=D0=BB=D1=8F=20rlm?= =?utf8?q?=5Fstg?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- projects/rlm_stg/rlm_stg.cpp | 36 ++++++++++-------------------------- 1 file changed, 10 insertions(+), 26 deletions(-) diff --git a/projects/rlm_stg/rlm_stg.cpp b/projects/rlm_stg/rlm_stg.cpp index 1cb652d7..bd8c82f7 100644 --- a/projects/rlm_stg/rlm_stg.cpp +++ b/projects/rlm_stg/rlm_stg.cpp @@ -92,7 +92,7 @@ static int stg_instantiate(CONF_SECTION *conf, void **instance) /* * Set up a storage area for instance data */ - DEBUG("rlm_stg: stg_instantiate()"); + DEBUG("rlm_stg: stg_instantiate()"); data = (rlm_stg_t *)rad_malloc(sizeof(rlm_stg_t)); if (!data) { return -1; @@ -116,11 +116,6 @@ static int stg_instantiate(CONF_SECTION *conf, void **instance) return -1; } - if (cli->Start()) { - DEBUG("rlm_stg: stg_instantiate() error: '%s'", cli->GetError().c_str()); - return -1; - } - *instance = data; return 0; @@ -132,17 +127,13 @@ static int stg_instantiate(CONF_SECTION *conf, void **instance) * from the database. The authentication code only needs to check * the password, the rest is done here. */ -static int stg_authorize(void *instance, REQUEST *request) +static int stg_authorize(void *, REQUEST *request) { VALUE_PAIR *uname; VALUE_PAIR *pwd; VALUE_PAIR *svc; DEBUG("rlm_stg: stg_authorize()"); - /* quiet the compiler */ - instance = instance; - request = request; - uname = pairfind(request->packet->vps, PW_USER_NAME); if (uname) { DEBUG("rlm_stg: stg_authorize() user name defined as '%s'", uname->vp_strvalue); @@ -181,13 +172,13 @@ static int stg_authorize(void *instance, REQUEST *request) /* * Authenticate the user with the given password. */ -static int stg_authenticate(void *instance, REQUEST *request) +static int stg_authenticate(void *, REQUEST *request) { /* quiet the compiler */ VALUE_PAIR *svc; - instance = instance; - request = request; + DEBUG("rlm_stg: stg_authenticate()"); + svc = pairfind(request->packet->vps, PW_SERVICE_TYPE); if (svc) { DEBUG("rlm_stg: stg_authenticate() Service-Type defined as '%s'", svc->vp_strvalue); @@ -209,11 +200,8 @@ static int stg_authenticate(void *instance, REQUEST *request) /* * Massage the request before recording it or proxying it */ -static int stg_preacct(void *instance, REQUEST *request) +static int stg_preacct(void *, REQUEST *) { - /* quiet the compiler */ - instance = instance; - request = request; DEBUG("rlm_stg: stg_preacct()"); return RLM_MODULE_OK; @@ -222,15 +210,14 @@ static int stg_preacct(void *instance, REQUEST *request) /* * Write accounting information to this modules database. */ -static int stg_accounting(void *instance, REQUEST *request) +static int stg_accounting(void *, REQUEST * request) { /* quiet the compiler */ VALUE_PAIR * sttype; VALUE_PAIR * svc; VALUE_PAIR * sessid; svc = pairfind(request->packet->vps, PW_SERVICE_TYPE); - instance = instance; - request = request; + DEBUG("rlm_stg: stg_accounting()"); sessid = pairfind(request->packet->vps, PW_ACCT_SESSION_ID); @@ -271,9 +258,8 @@ static int stg_accounting(void *instance, REQUEST *request) * max. number of logins, do a second pass and validate all * logins by querying the terminal server (using eg. SNMP). */ -static int stg_checksimul(void *instance, REQUEST *request) +static int stg_checksimul(void *, REQUEST *request) { - instance = instance; DEBUG("rlm_stg: stg_checksimul()"); request->simul_count=0; @@ -281,9 +267,8 @@ static int stg_checksimul(void *instance, REQUEST *request) return RLM_MODULE_OK; } -static int stg_postauth(void *instance, REQUEST *request) +static int stg_postauth(void *, REQUEST *request) { - instance = instance; VALUE_PAIR *fia; VALUE_PAIR *svc; struct in_addr fip; @@ -315,7 +300,6 @@ static int stg_postauth(void *instance, REQUEST *request) static int stg_detach(void *instance) { DEBUG("rlm_stg: stg_detach()"); - cli->Stop(); delete cli; free(((struct rlm_stg_t *)instance)->server); free(((struct rlm_stg_t *)instance)->password); -- 2.44.2