]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Move postauth call for Accept into post_handler (same as 3.0)
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sun, 23 Dec 2012 20:01:30 +0000 (20:01 +0000)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sun, 23 Dec 2012 20:06:41 +0000 (20:06 +0000)
src/main/auth.c
src/main/event.c

index d922c36bf1a6518c1f88044a8e128cb37b08050c..0e1d89259ed72f68db46166e04c66e7a9ee81386 100644 (file)
@@ -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;
 }
index cae48f0cd9fc4130a27c8b2aa2ce939777b3fab7..0c09f930da20f39716773e31b55ffc26083d0a01 100644 (file)
@@ -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