From b2c9e10a6d978db18a527d1498fb69def2b4fa61 Mon Sep 17 00:00:00 2001 From: Arran Cudbard-Bell Date: Wed, 30 Apr 2014 19:24:56 +0100 Subject: [PATCH] Add CC_HINT(nonnull) to module functions which were missed --- src/modules/rlm_always/rlm_always.c | 20 +++++++++--------- src/modules/rlm_cache/rlm_cache.c | 14 ++++++------- src/modules/rlm_counter/rlm_counter.c | 4 ++-- src/modules/rlm_exec/rlm_exec.c | 22 ++++++++++---------- src/modules/rlm_files/rlm_files.c | 8 ++++---- src/modules/rlm_linelog/rlm_linelog.c | 22 ++++++++++---------- src/modules/rlm_passwd/rlm_passwd.c | 12 +++++------ src/modules/rlm_realm/rlm_realm.c | 4 ++-- src/modules/rlm_sometimes/rlm_sometimes.c | 25 +++++++++++------------ src/modules/rlm_utf8/rlm_utf8.c | 8 ++++---- 10 files changed, 69 insertions(+), 70 deletions(-) diff --git a/src/modules/rlm_always/rlm_always.c b/src/modules/rlm_always/rlm_always.c index 08a671450b52..52f9c1784aa0 100644 --- a/src/modules/rlm_always/rlm_always.c +++ b/src/modules/rlm_always/rlm_always.c @@ -97,7 +97,7 @@ static int mod_instantiate(UNUSED CONF_SECTION *conf, void *instance) * Just return the rcode ... this function is autz, auth, acct, and * preacct! */ -static rlm_rcode_t always_return(void *instance, UNUSED REQUEST *request) +static rlm_rcode_t CC_HINT(nonnull) mod_always_return(void *instance, UNUSED REQUEST *request) { return ((struct rlm_always_t *)instance)->rcode; } @@ -128,22 +128,22 @@ module_t rlm_always = { mod_instantiate, /* instantiation */ NULL, /* detach */ { - always_return, /* authentication */ - always_return, /* authorization */ - always_return, /* preaccounting */ - always_return, /* accounting */ + mod_always_return, /* authentication */ + mod_always_return, /* authorization */ + mod_always_return, /* preaccounting */ + mod_always_return, /* accounting */ #ifdef WITH_SESSION_MGMT mod_checksimul, /* checksimul */ #else NULL, #endif - always_return, /* pre-proxy */ - always_return, /* post-proxy */ - always_return /* post-auth */ + mod_always_return, /* pre-proxy */ + mod_always_return, /* post-proxy */ + mod_always_return /* post-auth */ #ifdef WITH_COA , - always_return, /* recv-coa */ - always_return /* send-coa */ + mod_always_return, /* recv-coa */ + mod_always_return /* send-coa */ #endif }, }; diff --git a/src/modules/rlm_cache/rlm_cache.c b/src/modules/rlm_cache/rlm_cache.c index 9bfc4873cf16..32eb37e5dfcc 100644 --- a/src/modules/rlm_cache/rlm_cache.c +++ b/src/modules/rlm_cache/rlm_cache.c @@ -851,7 +851,7 @@ static int mod_instantiate(CONF_SECTION *conf, void *instance) * If you want to cache something different in different sections, * configure another cache module. */ -static rlm_rcode_t cache_it(void *instance, REQUEST *request) +static rlm_rcode_t CC_HINT(nonnull) mod_cache_it(void *instance, REQUEST *request) { rlm_cache_entry_t *c; rlm_cache_t *inst = instance; @@ -916,12 +916,12 @@ module_t rlm_cache = { mod_detach, /* detach */ { NULL, /* authentication */ - cache_it, /* authorization */ - cache_it, /* preaccounting */ - cache_it, /* accounting */ + mod_cache_it, /* authorization */ + mod_cache_it, /* preaccounting */ + mod_cache_it, /* accounting */ NULL, /* checksimul */ - cache_it, /* pre-proxy */ - cache_it, /* post-proxy */ - cache_it, /* post-auth */ + mod_cache_it, /* pre-proxy */ + mod_cache_it, /* post-proxy */ + mod_cache_it, /* post-auth */ }, }; diff --git a/src/modules/rlm_counter/rlm_counter.c b/src/modules/rlm_counter/rlm_counter.c index 3c6fe38e19f5..6201616a3332 100644 --- a/src/modules/rlm_counter/rlm_counter.c +++ b/src/modules/rlm_counter/rlm_counter.c @@ -874,9 +874,9 @@ module_t rlm_counter = { mod_detach, /* detach */ { NULL, /* authentication */ - mod_authorize, /* authorization */ + mod_authorize, /* authorization */ NULL, /* preaccounting */ - mod_accounting, /* accounting */ + mod_accounting, /* accounting */ NULL, /* checksimul */ NULL, /* pre-proxy */ NULL, /* post-proxy */ diff --git a/src/modules/rlm_exec/rlm_exec.c b/src/modules/rlm_exec/rlm_exec.c index 713405fead53..7a6bbce9022f 100644 --- a/src/modules/rlm_exec/rlm_exec.c +++ b/src/modules/rlm_exec/rlm_exec.c @@ -289,7 +289,7 @@ static int mod_instantiate(CONF_SECTION *conf, void *instance) /* * Dispatch an exec method */ -static rlm_rcode_t exec_dispatch(void *instance, REQUEST *request) +static rlm_rcode_t CC_HINT(nonnull) mod_exec_dispatch(void *instance, REQUEST *request) { rlm_exec_t *inst = (rlm_exec_t *)instance; rlm_rcode_t rcode; @@ -389,7 +389,7 @@ static rlm_rcode_t CC_HINT(nonnull) mod_post_auth(void *instance, REQUEST *reque return RLM_MODULE_NOOP; } - rcode = exec_dispatch(instance, request); + rcode = mod_exec_dispatch(instance, request); goto finish; } @@ -424,7 +424,7 @@ static rlm_rcode_t CC_HINT(nonnull) mod_post_auth(void *instance, REQUEST *reque * * Then, call exec_dispatch. */ -static rlm_rcode_t mod_accounting(void *instance, REQUEST *request) +static rlm_rcode_t CC_HINT(nonnull) mod_accounting(void *instance, REQUEST *request) { rlm_exec_t *inst = (rlm_exec_t *) instance; int status; @@ -438,7 +438,7 @@ static rlm_rcode_t mod_accounting(void *instance, REQUEST *request) * Exec-Program and Exec-Program-Wait. */ if (!inst->bare) { - return exec_dispatch(instance, request); + return mod_exec_dispatch(instance, request); } vp = pairfind(request->reply->vps, PW_EXEC_PROGRAM, 0, TAG_ANY); @@ -475,17 +475,17 @@ module_t rlm_exec = { mod_instantiate, /* instantiation */ NULL, /* detach */ { - exec_dispatch, /* authentication */ - exec_dispatch, /* authorization */ - exec_dispatch, /* pre-accounting */ + mod_exec_dispatch, /* authentication */ + mod_exec_dispatch, /* authorization */ + mod_exec_dispatch, /* pre-accounting */ mod_accounting, /* accounting */ NULL, /* check simul */ - exec_dispatch, /* pre-proxy */ - exec_dispatch, /* post-proxy */ + mod_exec_dispatch, /* pre-proxy */ + mod_exec_dispatch, /* post-proxy */ mod_post_auth /* post-auth */ #ifdef WITH_COA - , exec_dispatch, - exec_dispatch + , mod_exec_dispatch, + mod_exec_dispatch #endif }, }; diff --git a/src/modules/rlm_files/rlm_files.c b/src/modules/rlm_files/rlm_files.c index c70d0b80d716..35873da8262f 100644 --- a/src/modules/rlm_files/rlm_files.c +++ b/src/modules/rlm_files/rlm_files.c @@ -507,7 +507,7 @@ static rlm_rcode_t CC_HINT(nonnull) mod_preacct(void *instance, REQUEST *request } #ifdef WITH_PROXY -static rlm_rcode_t file_preproxy(void *instance, REQUEST *request) +static rlm_rcode_t CC_HINT(nonnull) mod_pre_proxy(void *instance, REQUEST *request) { rlm_files_t *inst = instance; @@ -516,7 +516,7 @@ static rlm_rcode_t file_preproxy(void *instance, REQUEST *request) request->packet->vps, &request->proxy->vps); } -static rlm_rcode_t file_postproxy(void *instance, REQUEST *request) +static rlm_rcode_t CC_HINT(nonnull) mod_post_proxy(void *instance, REQUEST *request) { rlm_files_t *inst = instance; @@ -561,8 +561,8 @@ module_t rlm_files = { NULL, /* accounting */ NULL, /* checksimul */ #ifdef WITH_PROXY - file_preproxy, /* pre-proxy */ - file_postproxy, /* post-proxy */ + mod_pre_proxy, /* pre-proxy */ + mod_post_proxy, /* post-proxy */ #else NULL, NULL, #endif diff --git a/src/modules/rlm_linelog/rlm_linelog.c b/src/modules/rlm_linelog/rlm_linelog.c index f74d18dff554..73007f30f234 100644 --- a/src/modules/rlm_linelog/rlm_linelog.c +++ b/src/modules/rlm_linelog/rlm_linelog.c @@ -196,7 +196,7 @@ static size_t linelog_escape_func(UNUSED REQUEST *request, return len; } -static rlm_rcode_t do_linelog(void *instance, REQUEST *request) +static rlm_rcode_t CC_HINT(nonnull) mod_do_linelog(void *instance, REQUEST *request) { int fd = -1; char buffer[4096]; @@ -345,17 +345,17 @@ module_t rlm_linelog = { mod_instantiate, /* instantiation */ NULL, /* detach */ { - do_linelog, /* authentication */ - do_linelog, /* authorization */ - do_linelog, /* preaccounting */ - do_linelog, /* accounting */ - NULL, /* checksimul */ - do_linelog, /* pre-proxy */ - do_linelog, /* post-proxy */ - do_linelog /* post-auth */ + mod_do_linelog, /* authentication */ + mod_do_linelog, /* authorization */ + mod_do_linelog, /* preaccounting */ + mod_do_linelog, /* accounting */ + NULL, /* checksimul */ + mod_do_linelog, /* pre-proxy */ + mod_do_linelog, /* post-proxy */ + mod_do_linelog /* post-auth */ #ifdef WITH_COA - , do_linelog, /* recv-coa */ - do_linelog /* send-coa */ + , mod_do_linelog, /* recv-coa */ + mod_do_linelog /* send-coa */ #endif }, }; diff --git a/src/modules/rlm_passwd/rlm_passwd.c b/src/modules/rlm_passwd/rlm_passwd.c index 49e447e1f3e3..08a955aeea7f 100644 --- a/src/modules/rlm_passwd/rlm_passwd.c +++ b/src/modules/rlm_passwd/rlm_passwd.c @@ -546,7 +546,7 @@ static void addresult (struct passwd_instance * inst, REQUEST *request, TALLOC_C } } -static rlm_rcode_t passwd_map(void *instance, REQUEST *request) +static rlm_rcode_t CC_HINT(nonnull) mod_passwd_map(void *instance, REQUEST *request) { #define inst ((struct passwd_instance *)instance) char buffer[1024]; @@ -595,16 +595,16 @@ module_t rlm_passwd = { mod_detach, /* detach */ { NULL, /* authentication */ - passwd_map, /* authorization */ + mod_passwd_map, /* authorization */ NULL, /* pre-accounting */ - passwd_map, /* accounting */ + mod_passwd_map, /* accounting */ NULL, /* checksimul */ NULL, /* pre-proxy */ NULL, /* post-proxy */ - passwd_map /* post-auth */ + mod_passwd_map /* post-auth */ #ifdef WITH_COA - , passwd_map, - passwd_map + , mod_passwd_map, + mod_passwd_map #endif }, }; diff --git a/src/modules/rlm_realm/rlm_realm.c b/src/modules/rlm_realm/rlm_realm.c index 57642adc4d92..2a8c56b65160 100644 --- a/src/modules/rlm_realm/rlm_realm.c +++ b/src/modules/rlm_realm/rlm_realm.c @@ -423,7 +423,7 @@ static rlm_rcode_t CC_HINT(nonnull) mod_preacct(void *instance, REQUEST *request * CoA realms via Operator-Name. Because the realm isn't in a * User-Name, concepts like "prefix" and "suffix' don't matter. */ -static rlm_rcode_t realm_recv_coa(UNUSED void *instance, REQUEST *request) +static rlm_rcode_t mod_realm_recv_coa(UNUSED void *instance, REQUEST *request) { VALUE_PAIR *vp; REALM *realm; @@ -489,7 +489,7 @@ module_t rlm_realm = { NULL, /* post-proxy */ NULL /* post-auth */ #ifdef WITH_COA - , realm_recv_coa, /* recv-coa */ + , mod_realm_recv_coa, /* recv-coa */ NULL /* send-coa */ #endif }, diff --git a/src/modules/rlm_sometimes/rlm_sometimes.c b/src/modules/rlm_sometimes/rlm_sometimes.c index 464494efc31c..6c681959721e 100644 --- a/src/modules/rlm_sometimes/rlm_sometimes.c +++ b/src/modules/rlm_sometimes/rlm_sometimes.c @@ -82,8 +82,7 @@ static int mod_instantiate(CONF_SECTION *conf, void *instance) /* * A lie! It always returns! */ -static rlm_rcode_t sometimes_return(void *instance, RADIUS_PACKET *packet, - RADIUS_PACKET *reply) +static rlm_rcode_t sometimes_return(void *instance, RADIUS_PACKET *packet, RADIUS_PACKET *reply) { uint32_t hash; int value; @@ -143,12 +142,12 @@ static rlm_rcode_t sometimes_return(void *instance, RADIUS_PACKET *packet, return inst->rcode; } -static rlm_rcode_t sometimes_packet(void *instance, REQUEST *request) +static rlm_rcode_t CC_HINT(nonnull) mod_sometimes_packet(void *instance, REQUEST *request) { return sometimes_return(instance, request->packet, request->reply); } -static rlm_rcode_t sometimes_reply(void *instance, REQUEST *request) +static rlm_rcode_t CC_HINT(nonnull) mod_sometimes_reply(void *instance, REQUEST *request) { return sometimes_return(instance, request->reply, NULL); } @@ -178,22 +177,22 @@ module_t rlm_sometimes = { mod_instantiate, /* instantiation */ NULL, /* detach */ { - sometimes_packet, /* authentication */ - sometimes_packet, /* authorization */ - sometimes_packet, /* preaccounting */ - sometimes_packet, /* accounting */ + mod_sometimes_packet, /* authentication */ + mod_sometimes_packet, /* authorization */ + mod_sometimes_packet, /* preaccounting */ + mod_sometimes_packet, /* accounting */ NULL, #ifdef WITH_PROXY - mod_pre_proxy, /* pre-proxy */ - mod_post_proxy, /* post-proxy */ + mod_pre_proxy, /* pre-proxy */ + mod_post_proxy, /* post-proxy */ #else NULL, NULL, #endif - sometimes_reply /* post-auth */ + mod_sometimes_reply /* post-auth */ #ifdef WITH_COA , - sometimes_packet, /* recv-coa */ - sometimes_reply /* send-coa */ + mod_sometimes_packet, /* recv-coa */ + mod_sometimes_reply /* send-coa */ #endif }, }; diff --git a/src/modules/rlm_utf8/rlm_utf8.c b/src/modules/rlm_utf8/rlm_utf8.c index 3ec0f5da63bf..082c6943282b 100644 --- a/src/modules/rlm_utf8/rlm_utf8.c +++ b/src/modules/rlm_utf8/rlm_utf8.c @@ -28,7 +28,7 @@ RCSID("$Id$") /* * Reject any non-UTF8 data. */ -static rlm_rcode_t utf8_clean(UNUSED void *instance, REQUEST *request) +static rlm_rcode_t CC_HINT(nonnull) mod_utf8_clean(UNUSED void *instance, REQUEST *request) { size_t i, len; VALUE_PAIR *vp; @@ -67,15 +67,15 @@ module_t rlm_utf8 = { NULL, /* detach */ { NULL, /* authentication */ - utf8_clean, /* authorization */ - utf8_clean, /* preaccounting */ + mod_utf8_clean, /* authorization */ + mod_utf8_clean, /* preaccounting */ NULL, /* accounting */ NULL, /* checksimul */ NULL, /* pre-proxy */ NULL, /* post-proxy */ NULL /* post-auth */ #ifdef WITH_COA - , utf8_clean, + , mod_utf8_clean, NULL #endif },