* Log the message to the logfile. Include the severity and
* a time stamp.
*/
+DIAG_OFF(format-nonliteral)
int vradlog(int lvl, char const *fmt, va_list ap)
{
struct main_config_t *myconfig = &mainconfig;
}
if (len < sizeof(buffer)) {
-DIAG_OFF(format-nonliteral)
len += vsnprintf(buffer + len, sizeof(buffer) - len - 1, fmt, ap);
-DIAG_ON(format-nonliteral)
}
/*
return 0;
}
+DIAG_ON(format-nonliteral)
int log_debug(char const *msg, ...)
{
return 0;
}
+DIAG_OFF(format-nonliteral)
void radlog_request(UNUSED int lvl, UNUSED int priority, UNUSED REQUEST *request, char const *msg, ...)
{
va_list ap;
char buffer[256];
-DIAG_OFF(format-nonliteral)
va_start(ap, msg);
vsnprintf(buffer, sizeof(buffer), msg, ap);
-DIAG_ON(format-nonliteral)
va_end(ap);
}
+DIAG_ON(format-nonliteral)
+DIAG_OFF(format-nonliteral)
int radlog(UNUSED int lvl, char const *msg, ...)
{
va_list ap;
char buffer[256];
va_start(ap, msg);
-DIAG_OFF(format-nonliteral)
vsnprintf(buffer, sizeof(buffer), msg, ap);
-DIAG_ON(format-nonliteral)
va_end(ap);
return 0;
}
+DIAG_ON(format-nonliteral)
static size_t xlat_test(UNUSED void *instance, UNUSED REQUEST *request,
UNUSED char const *fmt, UNUSED char *out, UNUSED size_t outlen)
/** Add a module failure message VALUE_PAIR to the request
*/
+DIAG_OFF(format-nonliteral)
void module_failure_msg(REQUEST *request, char const *fmt, ...)
{
size_t len;
len = snprintf(vp->vp_strvalue, sizeof(vp->vp_strvalue), "%s: ", request->module);
-DIAG_OFF(format-nonliteral)
vsnprintf(vp->vp_strvalue + len, sizeof(vp->vp_strvalue) - len, fmt, ap);
-DIAG_ON(format-nonliteral)
pairadd(&request->packet->vps, vp);
}
+DIAG_ON(format-nonliteral)
* @param instance rlm_ldap instance.
* @return A new connection handle or NULL on error.
*/
+DIAG_OFF(implicit-function-declaration)
+DIAG_OFF(nested-externs)
void *mod_conn_create(void *instance)
{
ldap_rcode_t status;
maybe_ldap_option(LDAP_OPT_X_TLS_CACERTDIR, "cacertdir", inst->tls_cacertdir);
# ifdef HAVE_LDAP_INT_TLS_CONFIG
-DIAG_OFF(implicit-function-declaration)
-DIAG_OFF(nested-externs)
if (ldap_int_tls_config(NULL, LDAP_OPT_X_TLS_REQUIRE_CERT, inst->tls_require_cert) != LDAP_OPT_SUCCESS) {
-DIAG_ON(nested-externs)
-DIAG_ON(implicit-function-declaration)
ldap_get_option(handle, LDAP_OPT_ERROR_NUMBER, &ldap_errno);
LDAP_ERR("Could not set LDAP_OPT_X_TLS_REQUIRE_CERT option to %s: %s", inst->tls_require_cert,
return NULL;
}
+DIAG_ON(nested-externs)
+DIAG_ON(implicit-function-declaration)
/** Close and delete a connection
free(handles);
}
+DIAG_OFF(shadow)
static void rlm_perl_destruct(PerlInterpreter *perl)
{
-DIAG_OFF(shadow)
dTHXa(perl);
PERL_SET_CONTEXT(perl);
{
dTHXa(perl);
}
-DIAG_ON(shadow)
/*
* FIXME: This shouldn't happen
*
perl_destruct(perl);
perl_free(perl);
}
+DIAG_ON(shadow)
static void rlm_destroy_perl(PerlInterpreter *perl)
{
return r;
}
/* handy SQL query tool */
+DIAG_OFF(format-nonliteral)
static int nvp_vquery(unsigned int line, rlm_sqlhpwippool_t *data,
rlm_sql_handle_t *sqlsock, char const *fmt, va_list ap)
{
char query[MAX_QUERY_LEN];
-DIAG_OFF(format-nonliteral)
vsnprintf(query, MAX_QUERY_LEN, fmt, ap);
-DIAG_ON(format-nonliteral)
if (rlm_sql_query(&sqlsock, data->sqlinst, query)) {
nvp_log(__LINE__, data, L_ERR, "nvp_vquery(): query from line %u: %s",
line, (char const *)(data->db->sql_error)(sqlsock, data->sqlinst->config));
return 1;
}
+DIAG_ON(format-nonliteral)
/* wrapper around nvp_vquery */
static int nvp_query(unsigned int line, rlm_sqlhpwippool_t *data,