]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Set Post-Proxy-Type Reject if the request was rejected by the proxy server
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 19 Dec 2012 18:06:05 +0000 (18:06 +0000)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 19 Dec 2012 18:06:21 +0000 (18:06 +0000)
src/main/event.c

index d839f8063d5f6d3fef0499266b919cdd73c12172..cd6dfce7f87862d769de9d8cf08adb7b1a4d9b55 100644 (file)
@@ -1719,6 +1719,24 @@ static int process_proxy_reply(REQUEST *request)
         *      BEFORE playing games with the attributes.
         */
        vp = pairfind(request->config_items, PW_POST_PROXY_TYPE);
+       
+       /*
+        *      If we have a proxy_reply, and it was a reject, setup
+        *      post-proxy-type Reject
+        */
+       if (!vp && request->proxy_reply &&
+           request->proxy_reply->code == PW_AUTHENTICATION_REJECT) {
+               DICT_VALUE      *dval;
+       
+               dval = dict_valbyname(PW_POST_PROXY_TYPE, "Reject");
+               if (!dval) return 0;
+                       
+               vp = radius_paircreate(request, &request->config_items,
+                                      PW_POST_PROXY_TYPE, PW_TYPE_INTEGER);
+
+               vp->vp_integer = dval->value;
+       }
+       
        if (vp) {
                RDEBUG2("  Found Post-Proxy-Type %s", vp->vp_strvalue);
                post_proxy_type = vp->vp_integer;