Skip to content

Commit

Permalink
Add CC_HINT(nonnull) to module functions which were missed
Browse files Browse the repository at this point in the history
  • Loading branch information
arr2036 committed Apr 30, 2014
1 parent 2678b04 commit b2c9e10
Show file tree
Hide file tree
Showing 10 changed files with 69 additions and 70 deletions.
20 changes: 10 additions & 10 deletions src/modules/rlm_always/rlm_always.c
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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
},
};
14 changes: 7 additions & 7 deletions src/modules/rlm_cache/rlm_cache.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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 */
},
};
4 changes: 2 additions & 2 deletions src/modules/rlm_counter/rlm_counter.c
Expand Up @@ -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 */
Expand Down
22 changes: 11 additions & 11 deletions src/modules/rlm_exec/rlm_exec.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
Expand All @@ -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);
Expand Down Expand Up @@ -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
},
};
8 changes: 4 additions & 4 deletions src/modules/rlm_files/rlm_files.c
Expand Up @@ -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;

Expand All @@ -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;

Expand Down Expand Up @@ -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
Expand Down
22 changes: 11 additions & 11 deletions src/modules/rlm_linelog/rlm_linelog.c
Expand Up @@ -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];
Expand Down Expand Up @@ -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
},
};
12 changes: 6 additions & 6 deletions src/modules/rlm_passwd/rlm_passwd.c
Expand Up @@ -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];
Expand Down Expand Up @@ -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
},
};
Expand Down
4 changes: 2 additions & 2 deletions src/modules/rlm_realm/rlm_realm.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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
},
Expand Down
25 changes: 12 additions & 13 deletions src/modules/rlm_sometimes/rlm_sometimes.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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
},
};
8 changes: 4 additions & 4 deletions src/modules/rlm_utf8/rlm_utf8.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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
},
Expand Down

0 comments on commit b2c9e10

Please sign in to comment.