Skip to content
This repository has been archived by the owner on Mar 12, 2019. It is now read-only.

Commit

Permalink
Use LOG_DEBUG instead of DEBUG for call to _log
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreF committed Oct 28, 2015
1 parent c8fd968 commit 3e8d376
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
16 changes: 8 additions & 8 deletions auth-plug.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ int mosquitto_auth_unpwd_check(void *userdata, const char *username, const char
/* Set name of back-end which authenticated */
backend_name = (authenticated) ? (*bep)->name : "none";

_log(DEBUG, "getuser(%s) AUTHENTICATED=%d by %s",
_log(LOG_DEBUG, "getuser(%s) AUTHENTICATED=%d by %s",
username, authenticated, (backend_name) ? backend_name : "none");

if (phash != NULL) {
Expand All @@ -455,7 +455,7 @@ int mosquitto_auth_acl_check(void *userdata, const char *clientid, const char *u
username = ud->anonusername;
}

_log(DEBUG, "mosquitto_auth_acl_check(..., %s, %s, %s, %s)",
_log(LOG_DEBUG, "mosquitto_auth_acl_check(..., %s, %s, %s, %s)",
clientid ? clientid : "NULL",
username ? username : "NULL",
topic ? topic : "NULL",
Expand All @@ -464,7 +464,7 @@ int mosquitto_auth_acl_check(void *userdata, const char *clientid, const char *u

granted = cache_q(clientid, username, topic, access, userdata);
if (granted != MOSQ_ERR_UNKNOWN) {
_log(DEBUG, "aclcheck(%s, %s, %d) CACHEDAUTH: %d",
_log(LOG_DEBUG, "aclcheck(%s, %s, %d) CACHEDAUTH: %d",
username, topic, access, granted);
return (granted);
}
Expand All @@ -479,7 +479,7 @@ int mosquitto_auth_acl_check(void *userdata, const char *clientid, const char *u

if (ud->superusers) {
if (fnmatch(ud->superusers, username, 0) == 0) {
_log(DEBUG, "aclcheck(%s, %s, %d) GLOBAL SUPERUSER=Y",
_log(LOG_DEBUG, "aclcheck(%s, %s, %d) GLOBAL SUPERUSER=Y",
username, topic, access);
granted = MOSQ_ERR_SUCCESS;
goto outout;
Expand All @@ -491,7 +491,7 @@ int mosquitto_auth_acl_check(void *userdata, const char *clientid, const char *u

match = b->superuser(b->conf, username);
if (match == 1) {
_log(DEBUG, "aclcheck(%s, %s, %d) SUPERUSER=Y by %s",
_log(LOG_DEBUG, "aclcheck(%s, %s, %d) SUPERUSER=Y by %s",
username, topic, access, b->name);
granted = MOSQ_ERR_SUCCESS;
goto outout;
Expand All @@ -508,15 +508,15 @@ int mosquitto_auth_acl_check(void *userdata, const char *clientid, const char *u
match = b->aclcheck((*bep)->conf, clientid, username, topic, access);
if (match == 1) {
backend_name = b->name;
_log(DEBUG, "aclcheck(%s, %s, %d) trying to acl with %s",
_log(LOG_DEBUG, "aclcheck(%s, %s, %d) trying to acl with %s",
username, topic, access, b->name);
authorized = TRUE;
break;
}
}


_log(DEBUG, "aclcheck(%s, %s, %d) AUTHORIZED=%d by %s",
_log(LOG_DEBUG, "aclcheck(%s, %s, %d) AUTHORIZED=%d by %s",
username, topic, access, authorized, backend_name);

granted = (authorized) ? MOSQ_ERR_SUCCESS : MOSQ_DENY_ACL;
Expand Down Expand Up @@ -551,7 +551,7 @@ int mosquitto_auth_psk_key_get(void *userdata, const char *hint, const char *ide

}

_log(DEBUG, "psk_key_get(%s, %s) from [%s] finds PSK: %d",
_log(LOG_DEBUG, "psk_key_get(%s, %s) from [%s] finds PSK: %d",
hint, identity, database,
psk_key ? 1 : 0);

Expand Down
8 changes: 4 additions & 4 deletions cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ void acl_cache(const char *clientid, const char *username, const char *topic, in
granted = a->granted;

if (time(NULL) > (a->seconds + cacheseconds)) {
_log(DEBUG, " Expired [%s] for (%s,%s,%d)", hex, clientid, username, access);
_log(LOG_DEBUG, " Expired [%s] for (%s,%s,%d)", hex, clientid, username, access);
HASH_DEL(ud->aclcache, a);
free(a);
}
Expand All @@ -119,7 +119,7 @@ void acl_cache(const char *clientid, const char *username, const char *topic, in
a->granted = granted;
a->seconds = now;
HASH_ADD_STR(ud->aclcache, hex, a);
_log(DEBUG, " Cached [%s] for (%s,%s,%d)", hex, clientid, username, access);
_log(LOG_DEBUG, " Cached [%s] for (%s,%s,%d)", hex, clientid, username, access);
}

/*
Expand All @@ -129,7 +129,7 @@ void acl_cache(const char *clientid, const char *username, const char *topic, in

HASH_ITER(hh, ud->aclcache, a, tmp) {
if (now > (a->seconds + ud->cacheseconds)) {
_log(DEBUG, " Cleanup [%s]", a->hex);
_log(LOG_DEBUG, " Cleanup [%s]", a->hex);
HASH_DEL(ud->aclcache, a);
free(a);
}
Expand Down Expand Up @@ -159,7 +159,7 @@ int cache_q(const char *clientid, const char *username, const char *topic, int a
// printf("---> CACHED! %d\n", a->granted);

if (time(NULL) > (a->seconds + cacheseconds)) {
_log(DEBUG, " Expired [%s] for (%s,%s,%d)", hex, clientid, username, access);
_log(LOG_DEBUG, " Expired [%s] for (%s,%s,%d)", hex, clientid, username, access);
HASH_DEL(ud->aclcache, a);
free(a);
} else {
Expand Down

0 comments on commit 3e8d376

Please sign in to comment.