From: Arran Cudbard-Bell Date: Sun, 23 Dec 2012 20:01:30 +0000 (+0000) Subject: Move postauth call for Accept into post_handler (same as 3.0) X-Git-Tag: release_2_2_1~195 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a00c44328013f0e166636f78badb080037d7e248;p=thirdparty%2Ffreeradius-server.git Move postauth call for Accept into post_handler (same as 3.0) --- diff --git a/src/main/auth.c b/src/main/auth.c index d922c36bf1a..0e1d89259ed 100644 --- a/src/main/auth.c +++ b/src/main/auth.c @@ -812,10 +812,11 @@ autz_redo: * Set the reply to Access-Accept, if it hasn't already * been set to something. (i.e. Access-Challenge) */ - if (request->reply->code == 0) - request->reply->code = PW_AUTHENTICATION_ACK; - - if ((module_msg = pairfind(request->packet->vps,PW_MODULE_SUCCESS_MESSAGE)) != NULL){ + if (request->reply->code == 0) { + request->reply->code = PW_AUTHENTICATION_ACK; + } + + if ((module_msg = pairfind(request->packet->vps, PW_MODULE_SUCCESS_MESSAGE)) != NULL){ char msg[MAX_STRING_LEN+12]; snprintf(msg, sizeof(msg), "Login OK (%s)", @@ -825,10 +826,5 @@ autz_redo: rad_authlog("Login OK", request, 1); } - /* - * Run the modules in the 'post-auth' section. - */ - result = rad_postauth(request); - return result; } diff --git a/src/main/event.c b/src/main/event.c index cae48f0cd9f..0c09f930da2 100644 --- a/src/main/event.c +++ b/src/main/event.c @@ -2413,8 +2413,7 @@ static void request_post_handler(REQUEST *request) * control:Response-Packet-Type attribute is present. */ vp = pairfind(request->config_items, - PW_RESPONSE_PACKET_TYPE); - + PW_RESPONSE_PACKET_TYPE); if (vp) { if (vp->vp_integer == 256) { RDEBUG2("Not responding to request %u", @@ -2475,6 +2474,11 @@ static void request_post_handler(REQUEST *request) return; } } + + if (request->reply->code == PW_AUTHENTICATION_ACK) { + rad_postauth(request); + } + /* FALL-THROUGH */ #ifdef WITH_COA