Enable building #WITHOUT_PROXY
[freeradius.git] / src / modules / rlm_realm / rlm_realm.c
index 6d6640e..e960a26 100644 (file)
@@ -80,18 +80,20 @@ static int check_for_realm(void *instance, REQUEST *request, REALM **returnrealm
         *      Also, if there's no User-Name attribute, we can't
         *      proxy it, either.
         */
+#ifdef WITH_PROXY
        if ((request->proxy != NULL) ||
            (request->username == NULL)) {
                RDEBUG2("Proxy reply, or no User-Name.  Ignoring.");
                return RLM_MODULE_OK;
        }
+#endif
 
        /*
         *      Check for 'Realm' attribute.  If it exists, then we've proxied
         *      it already ( via another rlm_realm instance ) and should return.
         */
 
-       if (pairfind(request->packet->vps, PW_REALM) != NULL ) {
+       if (pairfind(request->packet->vps, PW_REALM, 0) != NULL ) {
                RDEBUG2("Request already proxied.  Ignoring.");
                return RLM_MODULE_OK;
        }
@@ -180,7 +182,7 @@ static int check_for_realm(void *instance, REQUEST *request, REALM **returnrealm
                 */
                if (request->username->attribute != PW_STRIPPED_USER_NAME) {
                        vp = radius_paircreate(request, &request->packet->vps,
-                                              PW_STRIPPED_USER_NAME,
+                                              PW_STRIPPED_USER_NAME, 0,
                                               PW_TYPE_STRING);
                        RDEBUG2("Adding Stripped-User-Name = \"%s\"", username);
                } else {
@@ -236,6 +238,7 @@ static int check_for_realm(void *instance, REQUEST *request, REALM **returnrealm
                break;
        }
 
+#ifdef WITH_PROXY
        RDEBUG2("Proxying request from user %s to realm %s",
               username, realm->name);
 
@@ -261,7 +264,7 @@ static int check_for_realm(void *instance, REQUEST *request, REALM **returnrealm
         *      that has already proxied the request, we don't need to do
         *      it again.
         */
-       vp = pairfind(request->packet->vps, PW_FREERADIUS_PROXIED_TO);
+       vp = pairfind(request->packet->vps, PW_FREERADIUS_PROXIED_TO, 0);
        if (vp && (request->packet->src_ipaddr.af == AF_INET)) {
                int i;
                fr_ipaddr_t my_ipaddr;
@@ -310,11 +313,13 @@ static int check_for_realm(void *instance, REQUEST *request, REALM **returnrealm
                }
 
        }
+#endif
 
        /*
         *      We got this far, which means we have a realm, set returnrealm
         */
        *returnrealm = realm;
+
        return RLM_MODULE_UPDATED;
 }