diff options
author | David Sommerseth <dazo@users.sourceforge.net> | 2008-10-04 00:11:39 +0200 |
---|---|---|
committer | David Sommerseth <dazo@users.sourceforge.net> | 2008-10-04 00:11:39 +0200 |
commit | da003cfcee25fc4fb98a061893b44f0eb0f43a7c (patch) | |
tree | acc67984a64b712dfab4123aaf882ed6d2654353 /database | |
parent | 1a3a4b3b242e1a045a5f08c91edd074865a85cee (diff) | |
download | eurephia-da003cfcee25fc4fb98a061893b44f0eb0f43a7c.tar.gz eurephia-da003cfcee25fc4fb98a061893b44f0eb0f43a7c.tar.xz eurephia-da003cfcee25fc4fb98a061893b44f0eb0f43a7c.zip |
Log review - changed log levels for all DEBUG(...) calls
Diffstat (limited to 'database')
-rw-r--r-- | database/eurephiadb-driver_template.c | 44 | ||||
-rw-r--r-- | database/sqlite/eurephiadb-sqlite.c | 44 | ||||
-rw-r--r-- | database/sqlite/sqlite.c | 2 |
3 files changed, 45 insertions, 45 deletions
diff --git a/database/eurephiadb-driver_template.c b/database/eurephiadb-driver_template.c index f640ee8..9e75d33 100644 --- a/database/eurephiadb-driver_template.c +++ b/database/eurephiadb-driver_template.c @@ -124,7 +124,7 @@ int eDBconnect(eurephiaCTX *ctx, const int argc, const char **argv) * You are free to use whatever parameter syntax you would like to use. */ - DEBUG(ctx, 10, "Function call: eDBconnect(ctx, %i, '...')", argc, dbame); + DEBUG(ctx, 20, "Function call: eDBconnect(ctx, %i, '...')", argc, dbame); // Connect to the database dbc = (eDBconn *) malloc(sizeof(eDBconn)+2); @@ -178,7 +178,7 @@ void eDBdisconnect(eurephiaCTX *ctx) { eDBconn *dbc = NULL; - DEBUG(ctx, 10, "Function call: eDBdisconnect(ctx)"); + DEBUG(ctx, 20, "Function call: eDBdisconnect(ctx)"); if( ctx->dbc == NULL ) { eurephia_log(ctx, LOG_WARNING, 0, "Database not open, cannot close database."); @@ -209,7 +209,7 @@ int eDBauth_TLS(eurephiaCTX *ctx, const char *org, const char *cname, const char int certid = 0; char *blid = NULL; - DEBUG(ctx, 10, "Function call: eDBauth_TLS(ctx, '%s', '%s', '%s', '%s', %s)", + DEBUG(ctx, 20, "Function call: eDBauth_TLS(ctx, '%s', '%s', '%s', '%s', %s)", org, cname, email, digest, depth); // Check if certificate is valid, and not too many attempts has been tried with the given certificate @@ -251,7 +251,7 @@ int eDBauth_TLS(eurephiaCTX *ctx, const char *org, const char *cname, const char eurephia_log(ctx, LOG_FATAL, 0, "Could not look up certificate information"); } - DEBUG(ctx, 10, "Result function call: eDBauth_TLS(ctx, '%s', '%s', '%s', '%s', %s) - %i", + DEBUG(ctx, 20, "Result function call: eDBauth_TLS(ctx, '%s', '%s', '%s', '%s', %s) - %i", org, cname, email, digest, depth, certid); return certid; @@ -264,7 +264,7 @@ int eDBauth_user(eurephiaCTX *ctx, const int certid, const char *username, const char *crpwd = NULL, *activated = NULL, *deactivated = NULL, *blid_uname = NULL, *blid_cert; int uicid = 0, uid = 0, pwdok = 0; - DEBUG(ctx, 10, "Function call: eDBauth_user(ctx, %i, '%s','xxxxxxxx')", certid, username); + DEBUG(ctx, 20, "Function call: eDBauth_user(ctx, %i, '%s','xxxxxxxx')", certid, username); // Generate SHA1 hash of password, used for password auth @@ -334,7 +334,7 @@ int eDBauth_user(eurephiaCTX *ctx, const int certid, const char *username, const } /* FREE SQL RESULT */ - DEBUG(ctx, 10, "Result function call: eDBauth_user(ctx, %i, '%s','xxxxxxxx') - %i", + DEBUG(ctx, 20, "Result function call: eDBauth_user(ctx, %i, '%s','xxxxxxxx') - %i", certid, username, uicid); return uicid; @@ -345,7 +345,7 @@ int eDBget_uid(eurephiaCTX *ctx, const int certid, const char *username) { int ret = 0; - DEBUG(ctx, 10, "Function call: eDBget_uid(ctx, %i, '%s')", certid, username); + DEBUG(ctx, 20, "Function call: eDBget_uid(ctx, %i, '%s')", certid, username); /* WORK TO DO -- DO SQL: "SELECT uid " @@ -372,7 +372,7 @@ int eDBblacklist_check(eurephiaCTX *ctx, const int type, const char *val) int atpexceed = -1, blacklisted = 0; char *atpid = NULL, *blid = NULL; - DEBUG(ctx, 10, "Function call: eDBblacklist_check(ctx, '%s', '%s')", + DEBUG(ctx, 20, "Function call: eDBblacklist_check(ctx, '%s', '%s')", eDBattempt_types[type].descr, val); /* WORK TO DO -- DO SQL: @@ -436,7 +436,7 @@ int eDBblacklist_check(eurephiaCTX *ctx, const int type, const char *val) } free_nullsafe(blid); - DEBUG(ctx, 10, "Result - function call: eDBblacklist_check(ctx, '%s', '%s') - %i", + DEBUG(ctx, 20, "Result - function call: eDBblacklist_check(ctx, '%s', '%s') - %i", eDBattempt_types[type].descr, val, blacklisted); return blacklisted; @@ -448,7 +448,7 @@ void eDBregister_attempt(eurephiaCTX *ctx, int type, int mode, const char *value char *id = NULL, *atmpt_block = NULL, *blid = NULL; int attempts = 0; - DEBUG(ctx, 10, "Function call: eDBregister_attempt(ctx, %s, %s, '%s')", + DEBUG(ctx, 20, "Function call: eDBregister_attempt(ctx, %s, %s, '%s')", eDBattempt_types[type].colname, (mode == ATTEMPT_RESET ? "ATTEMPT_RESET" : "ATTEMPT_REGISTER"), value); @@ -550,7 +550,7 @@ int eDBregister_login(eurephiaCTX *ctx, eurephiaSESSION *skey, const int certid, const char *proto, const char *remipaddr, const char *remport, const char *vpnipaddr, const char *vpnipmask) { - DEBUG(ctx, 10, "Function call: eDBregister_login(ctx, '%s', %i, %i, '%s','%s','%s','%s','%s')", + DEBUG(ctx, 20, "Function call: eDBregister_login(ctx, '%s', %i, %i, '%s','%s','%s','%s','%s')", skey->sessionkey, certid, uid, proto, remipaddr, remport, vpnipaddr, vpnipmask); if( skey->sessionstatus != SESSION_NEW ) { @@ -579,7 +579,7 @@ int eDBregister_login(eurephiaCTX *ctx, eurephiaSESSION *skey, const int certid, int eDBregister_vpnmacaddr(eurephiaCTX *ctx, eurephiaSESSION *session, const char *macaddr) { - DEBUG(ctx, 10, "Function call: eDBregister_vpnmacaddr(ctx, '%s', '%s')", + DEBUG(ctx, 20, "Function call: eDBregister_vpnmacaddr(ctx, '%s', '%s')", session->sessionkey, macaddr); if( macaddr == NULL ) { @@ -623,7 +623,7 @@ int eDBregister_vpnmacaddr(eurephiaCTX *ctx, eurephiaSESSION *session, const cha int eDBregister_logout(eurephiaCTX *ctx, eurephiaSESSION *skey, const char *bytes_sent, const char *bytes_received, const char *duration) { - DEBUG(ctx, 10, "Function call: eDBregister_logout(ctx, '%s', %s, %s)", + DEBUG(ctx, 20, "Function call: eDBregister_logout(ctx, '%s', %s, %s)", skey->sessionkey, bytes_sent, bytes_received); /* WORK TO DO -- DO SQL: @@ -651,7 +651,7 @@ int eDBregister_logout(eurephiaCTX *ctx, eurephiaSESSION *skey, char *eDBget_sessionkey_seed(eurephiaCTX *ctx, const char *sessionseed) { char *skey = NULL; - DEBUG(ctx, 10, "eDBget_sessionkey(ctx, '%s')", sessionseed); + DEBUG(ctx, 20, "eDBget_sessionkey(ctx, '%s')", sessionseed); if( sessionseed == NULL ) { eurephia_log(ctx, LOG_FATAL, 1, @@ -711,7 +711,7 @@ char *eDBget_sessionkey_macaddr(eurephiaCTX *ctx, const char *macaddr) { int eDBcheck_sessionkey_uniqueness(eurephiaCTX *ctx, const char *seskey) { int uniq = 0; - DEBUG(ctx, 10, "eDBcheck_sessionkey_uniqueness(ctx, '%s')", seskey); + DEBUG(ctx, 20, "eDBcheck_sessionkey_uniqueness(ctx, '%s')", seskey); if( seskey == NULL ) { eurephia_log(ctx, LOG_FATAL, 1, "eDBcheck_sessionkey_uniqness: Invalid session key given"); @@ -736,7 +736,7 @@ int eDBcheck_sessionkey_uniqueness(eurephiaCTX *ctx, const char *seskey) { // register a link between a short-term session seed and a long-term session key int eDBregister_sessionkey(eurephiaCTX *ctx, const char *seed, const char *seskey) { - DEBUG(ctx, 10, "eDBregister_sessionkey(ctx, '%s', '%s')", seed, seskey); + DEBUG(ctx, 20, "eDBregister_sessionkey(ctx, '%s', '%s')", seed, seskey); if( (seed == NULL) || (seskey == NULL) ) { eurephia_log(ctx, LOG_FATAL, 1, "eDBregister_sessionkey: Invalid session seed or session key given"); @@ -759,7 +759,7 @@ int eDBregister_sessionkey(eurephiaCTX *ctx, const char *seed, const char *seske // remove a session seed/session key link from openvpn_sessionkeys int eDBremove_sessionkey(eurephiaCTX *ctx, const char *seskey) { - DEBUG(ctx, 10, "eDBremove_sessionkey(ctx, '%s')", seskey); + DEBUG(ctx, 20, "eDBremove_sessionkey(ctx, '%s')", seskey); if( seskey == NULL ) { eurephia_log(ctx, LOG_FATAL, 1, "eDBremove_sessionkey: Invalid session key given"); @@ -788,7 +788,7 @@ eurephiaVALUES *eDBload_sessiondata(eurephiaCTX *ctx, const char *sesskey) { return NULL; } - DEBUG(ctx, 10, "Function call: eDBload_sessiondata(ctx, '%s')", sesskey); + DEBUG(ctx, 20, "Function call: eDBload_sessiondata(ctx, '%s')", sesskey); sessvals = eCreate_value_space(ctx, 10); @@ -817,12 +817,12 @@ int eDBstore_session_value(eurephiaCTX *ctx, eurephiaSESSION *session, int mode, { if( session == NULL ) { - DEBUG(ctx, 10, + DEBUG(ctx, 20, "Function call failed to eDBstore_session_value(ctx, ...): Non-existing session key"); return 0; } - DEBUG(ctx, 10, "Function call: eDBstore_session_value(ctx, '%s', %i, '%s', '%s')", + DEBUG(ctx, 20, "Function call: eDBstore_session_value(ctx, '%s', %i, '%s', '%s')", session->sessionkey, mode, key, val); switch( mode ) { @@ -880,7 +880,7 @@ int eDBstore_session_value(eurephiaCTX *ctx, eurephiaSESSION *session, int mode, // Delete session information from openvpn_sessions and update openvpn_lastlog with status int eDBdestroy_session(eurephiaCTX *ctx, eurephiaSESSION *session) { - DEBUG(ctx, 10, "Function call: eDBdestroy_session(ctx, '%s')", session->sessionkey); + DEBUG(ctx, 20, "Function call: eDBdestroy_session(ctx, '%s')", session->sessionkey); if( (session == NULL) || (session->sessionkey == NULL) ) { eurephia_log(ctx, LOG_ERROR, 1, "No active session given to be destroyed"); @@ -925,7 +925,7 @@ char *eDBget_firewall_profile(eurephiaCTX *ctx, eurephiaSESSION *session) { char *ret = NULL; - DEBUG(ctx, 10, "Function call: eDBget_firewall_profile(ctx, {session}'%s')", + DEBUG(ctx, 20, "Function call: eDBget_firewall_profile(ctx, {session}'%s')", session->sessionkey); /* WORK TO DO -- DO SQL: diff --git a/database/sqlite/eurephiadb-sqlite.c b/database/sqlite/eurephiadb-sqlite.c index bdfbea5..03cff02 100644 --- a/database/sqlite/eurephiadb-sqlite.c +++ b/database/sqlite/eurephiadb-sqlite.c @@ -102,7 +102,7 @@ int eDBconnect(eurephiaCTX *ctx, const int argc, const char **argv) dbresult *res = NULL; int rc; - DEBUG(ctx, 10, "Function call: eDBconnect(ctx, %i, '%s')", argc, argv[0]); + DEBUG(ctx, 20, "Function call: eDBconnect(ctx, %i, '%s')", argc, argv[0]); if( (argc != 1) || (argv[0] == NULL) || (strlen(argv[0]) < 1) ) { eurephia_log(ctx, LOG_PANIC, 0, "Wrong parameters to dblink-sqlite. Cannot open database."); @@ -154,7 +154,7 @@ void eDBdisconnect(eurephiaCTX *ctx) { eDBconn *dbc = NULL; - DEBUG(ctx, 10, "Function call: eDBdisconnect(ctx)"); + DEBUG(ctx, 20, "Function call: eDBdisconnect(ctx)"); if( ctx->dbc == NULL ) { eurephia_log(ctx, LOG_WARNING, 0, "Database not open, cannot close database."); @@ -185,7 +185,7 @@ int eDBauth_TLS(eurephiaCTX *ctx, const char *org, const char *cname, const char int certid = 0; char *blid = NULL; - DEBUG(ctx, 10, "Function call: eDBauth_TLS(ctx, '%s', '%s', '%s', '%s', %s)", + DEBUG(ctx, 20, "Function call: eDBauth_TLS(ctx, '%s', '%s', '%s', '%s', %s)", org, cname, email, digest, depth); // Check if certificate is valid, and not too many attempts has been tried with the given certificate @@ -226,7 +226,7 @@ int eDBauth_TLS(eurephiaCTX *ctx, const char *org, const char *cname, const char eurephia_log(ctx, LOG_FATAL, 0, "Could not look up certificate information"); } - DEBUG(ctx, 10, "Result function call: eDBauth_TLS(ctx, '%s', '%s', '%s', '%s', %s) - %i", + DEBUG(ctx, 20, "Result function call: eDBauth_TLS(ctx, '%s', '%s', '%s', '%s', %s) - %i", org, cname, email, digest, depth, certid); return certid; @@ -240,7 +240,7 @@ int eDBauth_user(eurephiaCTX *ctx, const int certid, const char *username, const char *crpwd = NULL, *activated = NULL, *deactivated = NULL, *blid_uname = NULL, *blid_cert; int uicid = 0, uid = 0, pwdok = 0; - DEBUG(ctx, 10, "Function call: eDBauth_user(ctx, %i, '%s','xxxxxxxx')", certid, username); + DEBUG(ctx, 20, "Function call: eDBauth_user(ctx, %i, '%s','xxxxxxxx')", certid, username); // Generate SHA1 hash of password, used for password auth @@ -305,7 +305,7 @@ int eDBauth_user(eurephiaCTX *ctx, const int certid, const char *username, const } sqlite_free_results(res); - DEBUG(ctx, 10, "Result function call: eDBauth_user(ctx, %i, '%s','xxxxxxxx') - %i", + DEBUG(ctx, 20, "Result function call: eDBauth_user(ctx, %i, '%s','xxxxxxxx') - %i", certid, username, uicid); return uicid; @@ -317,7 +317,7 @@ int eDBget_uid(eurephiaCTX *ctx, const int certid, const char *username) dbresult *res = NULL; int ret = 0; - DEBUG(ctx, 10, "Function call: eDBget_uid(ctx, %i, '%s')", certid, username); + DEBUG(ctx, 20, "Function call: eDBget_uid(ctx, %i, '%s')", certid, username); res = sqlite_query(ctx, "SELECT uid " @@ -344,7 +344,7 @@ int eDBblacklist_check(eurephiaCTX *ctx, const int type, const char *val) int atpexceed = -1, blacklisted = 0; char *atpid = NULL, *blid = NULL; - DEBUG(ctx, 10, "Function call: eDBblacklist_check(ctx, '%s', '%s')", + DEBUG(ctx, 20, "Function call: eDBblacklist_check(ctx, '%s', '%s')", eDBattempt_types[type].descr, val); blr = sqlite_query(ctx, "SELECT blid FROM openvpn_blacklist WHERE %s = '%q'", @@ -404,7 +404,7 @@ int eDBblacklist_check(eurephiaCTX *ctx, const int type, const char *val) } free_nullsafe(blid); - DEBUG(ctx, 10, "Result - function call: eDBblacklist_check(ctx, '%s', '%s') - %i", + DEBUG(ctx, 20, "Result - function call: eDBblacklist_check(ctx, '%s', '%s') - %i", eDBattempt_types[type].descr, val, blacklisted); return blacklisted; @@ -416,7 +416,7 @@ void eDBregister_attempt(eurephiaCTX *ctx, int type, int mode, const char *value char *id = NULL, *atmpt_block = NULL, *blid = NULL; int attempts = 0; - DEBUG(ctx, 10, "Function call: eDBregister_attempt(ctx, %s, %s, '%s')", + DEBUG(ctx, 20, "Function call: eDBregister_attempt(ctx, %s, %s, '%s')", eDBattempt_types[type].colname, (mode == ATTEMPT_RESET ? "ATTEMPT_RESET" : "ATTEMPT_REGISTER"), value); @@ -504,7 +504,7 @@ int eDBregister_login(eurephiaCTX *ctx, eurephiaSESSION *skey, const int certid, { dbresult *res = NULL; - DEBUG(ctx, 10, "Function call: eDBregister_login(ctx, '%s', %i, %i, '%s','%s','%s','%s','%s')", + DEBUG(ctx, 20, "Function call: eDBregister_login(ctx, '%s', %i, %i, '%s','%s','%s','%s','%s')", skey->sessionkey, certid, uid, proto, remipaddr, remport, vpnipaddr, vpnipmask); if( skey->sessionstatus != SESSION_NEW ) { @@ -533,7 +533,7 @@ int eDBregister_vpnmacaddr(eurephiaCTX *ctx, eurephiaSESSION *session, const cha { dbresult *res = NULL; - DEBUG(ctx, 10, "Function call: eDBregister_vpnmacaddr(ctx, '%s', '%s')", + DEBUG(ctx, 20, "Function call: eDBregister_vpnmacaddr(ctx, '%s', '%s')", session->sessionkey, macaddr); if( macaddr == NULL ) { @@ -577,7 +577,7 @@ int eDBregister_logout(eurephiaCTX *ctx, eurephiaSESSION *skey, { dbresult *res = NULL; - DEBUG(ctx, 10, "Function call: eDBregister_logout(ctx, '%s', %s, %s)", + DEBUG(ctx, 20, "Function call: eDBregister_logout(ctx, '%s', %s, %s)", skey->sessionkey, bytes_sent, bytes_received); res = sqlite_query(ctx, @@ -604,7 +604,7 @@ char *eDBget_sessionkey_seed(eurephiaCTX *ctx, const char *sessionseed) { dbresult *res = NULL; char *skey = NULL; - DEBUG(ctx, 10, "eDBget_sessionkey(ctx, '%s')", sessionseed); + DEBUG(ctx, 20, "eDBget_sessionkey(ctx, '%s')", sessionseed); if( sessionseed == NULL ) { eurephia_log(ctx, LOG_FATAL, 1, @@ -661,7 +661,7 @@ int eDBcheck_sessionkey_uniqueness(eurephiaCTX *ctx, const char *seskey) { dbresult *res; int uniq = 0; - DEBUG(ctx, 10, "eDBcheck_sessionkey_uniqueness(ctx, '%s')", seskey); + DEBUG(ctx, 20, "eDBcheck_sessionkey_uniqueness(ctx, '%s')", seskey); if( seskey == NULL ) { eurephia_log(ctx, LOG_FATAL, 1, "eDBcheck_sessionkey_uniqness: Invalid session key given"); @@ -686,7 +686,7 @@ int eDBcheck_sessionkey_uniqueness(eurephiaCTX *ctx, const char *seskey) { int eDBregister_sessionkey(eurephiaCTX *ctx, const char *seed, const char *seskey) { dbresult *res; - DEBUG(ctx, 10, "eDBregister_sessionkey(ctx, '%s', '%s')", seed, seskey); + DEBUG(ctx, 20, "eDBregister_sessionkey(ctx, '%s', '%s')", seed, seskey); if( (seed == NULL) || (seskey == NULL) ) { eurephia_log(ctx, LOG_FATAL, 1, "eDBregister_sessionkey: Invalid session seed or session key given"); @@ -709,7 +709,7 @@ int eDBregister_sessionkey(eurephiaCTX *ctx, const char *seed, const char *seske int eDBremove_sessionkey(eurephiaCTX *ctx, const char *seskey) { dbresult *res; - DEBUG(ctx, 10, "eDBremove_sessionkey(ctx, '%s')", seskey); + DEBUG(ctx, 20, "eDBremove_sessionkey(ctx, '%s')", seskey); if( seskey == NULL ) { eurephia_log(ctx, LOG_FATAL, 1, "eDBremove_sessionkey: Invalid session key given"); @@ -736,7 +736,7 @@ eurephiaVALUES *eDBload_sessiondata(eurephiaCTX *ctx, const char *sesskey) { return NULL; } - DEBUG(ctx, 10, "Function call: eDBload_sessiondata(ctx, '%s')", sesskey); + DEBUG(ctx, 20, "Function call: eDBload_sessiondata(ctx, '%s')", sesskey); sessvals = eCreate_value_space(ctx, 10); @@ -764,12 +764,12 @@ int eDBstore_session_value(eurephiaCTX *ctx, eurephiaSESSION *session, int mode, dbresult *res = NULL; if( session == NULL ) { - DEBUG(ctx, 10, + DEBUG(ctx, 20, "Function call failed to eDBstore_session_value(ctx, ...): Non-existing session key"); return 0; } - DEBUG(ctx, 10, "Function call: eDBstore_session_value(ctx, '%s', %i, '%s', '%s')", + DEBUG(ctx, 20, "Function call: eDBstore_session_value(ctx, '%s', %i, '%s', '%s')", session->sessionkey, mode, key, val); switch( mode ) { @@ -822,7 +822,7 @@ int eDBstore_session_value(eurephiaCTX *ctx, eurephiaSESSION *session, int mode, int eDBdestroy_session(eurephiaCTX *ctx, eurephiaSESSION *session) { dbresult *res = NULL; - DEBUG(ctx, 10, "Function call: eDBdestroy_session(ctx, '%s')", session->sessionkey); + DEBUG(ctx, 20, "Function call: eDBdestroy_session(ctx, '%s')", session->sessionkey); if( (session == NULL) || (session->sessionkey == NULL) ) { eurephia_log(ctx, LOG_ERROR, 1, "No active session given to be destroyed"); @@ -863,7 +863,7 @@ char *eDBget_firewall_profile(eurephiaCTX *ctx, eurephiaSESSION *session) char *ret = NULL; dbresult *res = NULL; - DEBUG(ctx, 10, "Function call: eDBget_firewall_profile(ctx, {session}'%s')", + DEBUG(ctx, 20, "Function call: eDBget_firewall_profile(ctx, {session}'%s')", session->sessionkey); res = sqlite_query(ctx, diff --git a/database/sqlite/sqlite.c b/database/sqlite/sqlite.c index 1a97793..85b41de 100644 --- a/database/sqlite/sqlite.c +++ b/database/sqlite/sqlite.c @@ -218,7 +218,7 @@ dbresult *sqlite_query(eurephiaCTX *ctx, char *fmt, ... ) { sql = sqlite3_vmprintf(fmt, ap); va_end(ap); - DEBUG(ctx, 11, "Doing SQL Query: %s", sql); + DEBUG(ctx, 25, "Doing SQL Query: %s", sql); rc = sqlite3_exec( (sqlite3 *) dbc->dbhandle, sql, _cb_parse_result, 0, &errMsg ); if( rc != SQLITE_OK ) { eurephia_log(ctx, LOG_ERROR, 0, "SQL Error: %s", errMsg); |