]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Coding style fixes.
authorAlejandro Perez <alex@um.es>
Mon, 29 May 2017 15:25:10 +0000 (17:25 +0200)
committerAlejandro Perez <alex@um.es>
Mon, 3 Jul 2017 07:50:51 +0000 (09:50 +0200)
* Trimmed trailing whites.
* Adopt proper line length.
* Add missing spaces after commas.

src/modules/rlm_realm/rlm_realm.c
src/modules/rlm_realm/trustrouter.c

index cc01c8b01d1d9fb1f153c5ba9eb73cd9da9493a7..c522bf4e6a5205826213bec4968cd0385807b36f 100644 (file)
@@ -52,10 +52,10 @@ static CONF_PARSER module_config[] = {
        { "ignore_default", FR_CONF_OFFSET(PW_TYPE_BOOLEAN, rlm_realm_t, ignore_default), "no" },
        { "ignore_null", FR_CONF_OFFSET(PW_TYPE_BOOLEAN, rlm_realm_t, ignore_null), "no" },
 #ifdef HAVE_TRUST_ROUTER_TR_DH_H
-       { "default_community", FR_CONF_OFFSET(PW_TYPE_STRING, rlm_realm_t,default_community),  "none" },
-       { "rp_realm", FR_CONF_OFFSET(PW_TYPE_STRING, rlm_realm_t,rp_realm),  "none" },
-       { "trust_router", FR_CONF_OFFSET(PW_TYPE_STRING, rlm_realm_t,trust_router),  "none" },
-       { "tr_port", FR_CONF_OFFSET(PW_TYPE_INTEGER, rlm_realm_t,tr_port),  "0" },
+       { "default_community", FR_CONF_OFFSET(PW_TYPE_STRING, rlm_realm_t, default_community),  "none" },
+       { "rp_realm", FR_CONF_OFFSET(PW_TYPE_STRING, rlm_realm_t, rp_realm),  "none" },
+       { "trust_router", FR_CONF_OFFSET(PW_TYPE_STRING, rlm_realm_t, trust_router),  "none" },
+       { "tr_port", FR_CONF_OFFSET(PW_TYPE_INTEGER, rlm_realm_t, tr_port),  "0" },
 #endif
        CONF_PARSER_TERMINATOR
 };
@@ -172,7 +172,8 @@ static int check_for_realm(void *instance, REQUEST *request, REALM **returnrealm
         *      Try querying for the dynamic realm.
         */
        if (!realm && inst->trust_router) {
-               realm = tr_query_realm(request, realmname, inst->default_community, inst->rp_realm, inst->trust_router, inst->tr_port);
+               realm = tr_query_realm(request, realmname, inst->default_community, inst->rp_realm, inst->trust_router,
+                                      inst->tr_port);
        } else {
                RDEBUG2("No trust router configured, skipping dynamic realm lookup");
        }
index 338fa4910b545b272fd74244785e67f1d48ba07a..39b122802e45af21bb2df5c98b278c7d90c81bec 100644 (file)
@@ -42,7 +42,7 @@ struct resp_opaque {
 };
 
 
-bool tr_init(void) 
+bool tr_init(void)
 {
        if (global_tidc) return true;
 
@@ -108,7 +108,7 @@ error:
        if (tls) talloc_free(tls);
        return NULL;
 }
-  
+
 static char *build_pool_name(TALLOC_CTX *ctx, TID_RESP *resp)
 {
        size_t index, sa_len, sl;
@@ -155,7 +155,7 @@ static home_server_t *srvr_blk_to_home_server(TALLOC_CTX *ctx,
        tid_srvr_get_address(blk, &sa, &sa_len);
 
        fr_sockaddr2ipaddr((struct sockaddr_storage *) sa, sa_len, &home_server_ip, &port);
-  
+
        if (0 != getnameinfo(sa, sa_len,
                             nametemp,
                             sizeof nametemp,
@@ -181,9 +181,9 @@ static home_server_t *srvr_blk_to_home_server(TALLOC_CTX *ctx,
        hs->secret = talloc_strdup(hs, "radsec");
        hs->response_window.tv_sec = 30;
        hs->last_packet_recv = time(NULL);
-       /* 
-        *  We want sockets using these servers to close as soon as possible, 
-        *  to make sure that whenever a pool is replaced, sockets using old ones 
+       /*
+        *  We want sockets using these servers to close as soon as possible,
+        *  to make sure that whenever a pool is replaced, sockets using old ones
         *  will not last long (hopefully less than 300s).
         */
        hs->limit.idle_timeout = 5;
@@ -258,7 +258,7 @@ static void tr_response_func( TIDC_INSTANCE *inst,
                }
                return;
        }
-               
+
        if (!nr) {
                nr = talloc_zero(NULL, REALM);
                if (!nr) goto error;
@@ -285,7 +285,7 @@ static void tr_response_func( TIDC_INSTANCE *inst,
 
        opaque->output_realm = nr;
        return;
-               
+
 error:
        if (nr && !opaque->orig_realm) {
                talloc_free(nr);
@@ -320,7 +320,7 @@ static bool update_required(REALM const *r)
                /*
                 *      These values don't make sense.
                 */
-               if ((server->last_packet_recv > (now + 5)) || 
+               if ((server->last_packet_recv > (now + 5)) ||
                    (server->last_failed_open > (now + 5))) {
                        continue;
                }
@@ -337,7 +337,7 @@ static bool update_required(REALM const *r)
        return true;
 }
 
-    
+
 
 REALM *tr_query_realm(REQUEST *request, char const *realm,
                      char const  *community,
@@ -374,7 +374,7 @@ REALM *tr_query_realm(REQUEST *request, char const *realm,
                talloc_free(cookie.fr_realm_name);
                return cookie.orig_realm;
        }
-    
+
        /* Set-up TID connection */
        DEBUG2("Opening TIDC connection to %s:%u", trustrouter, port);
 
@@ -386,8 +386,8 @@ REALM *tr_query_realm(REQUEST *request, char const *realm,
        }
 
        /* Send a TID request */
-       rcode = tidc_send_request(global_tidc, conn, gssctx, (char *)rprealm, 
-                                 (char *) realm, (char *)community, 
+       rcode = tidc_send_request(global_tidc, conn, gssctx, (char *)rprealm,
+                                 (char *) realm, (char *)community,
                                  &tr_response_func, &cookie);
        if (rcode < 0) {
                /* Handle error */
@@ -397,7 +397,7 @@ REALM *tr_query_realm(REQUEST *request, char const *realm,
        if (cookie.result != TID_SUCCESS) {
                DEBUG2("TID response is error, rc = %d: %s.\n", cookie.result,
                       cookie.err_msg?cookie.err_msg:"(NO ERROR TEXT)");
-               if (cookie.err_msg) 
+               if (cookie.err_msg)
                        pair_make_reply("Reply-Message", cookie.err_msg, T_OP_SET);
                pair_make_reply("Error-Cause", "502", T_OP_SET); /*proxy unroutable*/
        }