Commit 7ae46647 authored by Philipp Schafft's avatar Philipp Schafft 🦁

Replace the old logging macros with variadic argument macros. (patch by ePirat) (close #2058)

svn path=/icecast/trunk/icecast/; revision=19229
parent 093b9439
This diff is collapsed.
...@@ -59,7 +59,7 @@ static auth_client *auth_client_setup (const char *mount, client_t *client) ...@@ -59,7 +59,7 @@ static auth_client *auth_client_setup (const char *mount, client_t *client)
userpass = util_base64_decode (header+6); userpass = util_base64_decode (header+6);
if (userpass == NULL) if (userpass == NULL)
{ {
WARN1("Base64 decode of Authorization header \"%s\" failed", LOG_WARN("Base64 decode of Authorization header \"%s\" failed",
header+6); header+6);
break; break;
} }
...@@ -79,7 +79,7 @@ static auth_client *auth_client_setup (const char *mount, client_t *client) ...@@ -79,7 +79,7 @@ static auth_client *auth_client_setup (const char *mount, client_t *client)
free (userpass); free (userpass);
break; break;
} }
INFO1 ("unhandled authorization header: %s", header); LOG_INFO("unhandled authorization header: %s", header);
} while (0); } while (0);
...@@ -109,17 +109,17 @@ static void queue_auth_client (auth_client *auth_user, mount_proxy *mountinfo) ...@@ -109,17 +109,17 @@ static void queue_auth_client (auth_client *auth_user, mount_proxy *mountinfo)
{ {
if (auth_user->client == NULL || auth_user->client->auth == NULL) if (auth_user->client == NULL || auth_user->client->auth == NULL)
{ {
WARN1 ("internal state is incorrect for %p", auth_user->client); LOG_WARN("internal state is incorrect for %p", auth_user->client);
return; return;
} }
auth = auth_user->client->auth; auth = auth_user->client->auth;
thread_mutex_lock (&auth->lock); thread_mutex_lock (&auth->lock);
} }
DEBUG2 ("...refcount on auth_t %s is now %d", auth->mount, auth->refcount); LOG_DEBUG("...refcount on auth_t %s is now %d", auth->mount, auth->refcount);
*auth->tailp = auth_user; *auth->tailp = auth_user;
auth->tailp = &auth_user->next; auth->tailp = &auth_user->next;
auth->pending_count++; auth->pending_count++;
INFO2 ("auth on %s has %d pending", auth->mount, auth->pending_count); LOG_INFO("auth on %s has %d pending", auth->mount, auth->pending_count);
thread_mutex_unlock (&auth->lock); thread_mutex_unlock (&auth->lock);
} }
...@@ -134,7 +134,7 @@ void auth_release (auth_t *authenticator) ...@@ -134,7 +134,7 @@ void auth_release (auth_t *authenticator)
thread_mutex_lock (&authenticator->lock); thread_mutex_lock (&authenticator->lock);
authenticator->refcount--; authenticator->refcount--;
DEBUG2 ("...refcount on auth_t %s is now %d", authenticator->mount, authenticator->refcount); LOG_DEBUG("...refcount on auth_t %s is now %d", authenticator->mount, authenticator->refcount);
if (authenticator->refcount) if (authenticator->refcount)
{ {
thread_mutex_unlock (&authenticator->lock); thread_mutex_unlock (&authenticator->lock);
...@@ -198,7 +198,7 @@ static void auth_new_listener (auth_t *auth, auth_client *auth_user) ...@@ -198,7 +198,7 @@ static void auth_new_listener (auth_t *auth, auth_client *auth_user)
* can be avoided if client has disconnected */ * can be avoided if client has disconnected */
if (is_listener_connected (client) == 0) if (is_listener_connected (client) == 0)
{ {
DEBUG0 ("listener is no longer connected"); LOG_DEBUG("listener is no longer connected");
client->respcode = 400; client->respcode = 400;
auth_release (client->auth); auth_release (client->auth);
client->auth = NULL; client->auth = NULL;
...@@ -217,7 +217,7 @@ static void auth_new_listener (auth_t *auth, auth_client *auth_user) ...@@ -217,7 +217,7 @@ static void auth_new_listener (auth_t *auth, auth_client *auth_user)
{ {
auth_release (client->auth); auth_release (client->auth);
client->auth = NULL; client->auth = NULL;
INFO1 ("client %lu failed", client->con->id); LOG_INFO("client %lu failed", client->con->id);
} }
} }
...@@ -252,7 +252,7 @@ static void stream_auth_callback (auth_t *auth, auth_client *auth_user) ...@@ -252,7 +252,7 @@ static void stream_auth_callback (auth_t *auth, auth_client *auth_user)
if (client->authenticated) if (client->authenticated)
auth_postprocess_source (auth_user); auth_postprocess_source (auth_user);
else else
WARN1 ("Failed auth for source \"%s\"", auth_user->mount); LOG_WARN("Failed auth for source \"%s\"", auth_user->mount);
} }
...@@ -283,7 +283,7 @@ static void *auth_run_thread (void *arg) ...@@ -283,7 +283,7 @@ static void *auth_run_thread (void *arg)
{ {
auth_t *auth = arg; auth_t *auth = arg;
INFO0 ("Authentication thread started"); LOG_INFO("Authentication thread started");
while (auth->running) while (auth->running)
{ {
/* usually no clients are waiting, so don't bother taking locks */ /* usually no clients are waiting, so don't bother taking locks */
...@@ -299,7 +299,7 @@ static void *auth_run_thread (void *arg) ...@@ -299,7 +299,7 @@ static void *auth_run_thread (void *arg)
thread_mutex_unlock (&auth->lock); thread_mutex_unlock (&auth->lock);
continue; continue;
} }
DEBUG2 ("%d client(s) pending on %s", auth->pending_count, auth->mount); LOG_DEBUG("%d client(s) pending on %s", auth->pending_count, auth->mount);
auth->head = auth_user->next; auth->head = auth_user->next;
if (auth->head == NULL) if (auth->head == NULL)
auth->tailp = &auth->head; auth->tailp = &auth->head;
...@@ -310,7 +310,7 @@ static void *auth_run_thread (void *arg) ...@@ -310,7 +310,7 @@ static void *auth_run_thread (void *arg)
if (auth_user->process) if (auth_user->process)
auth_user->process (auth, auth_user); auth_user->process (auth, auth_user);
else else
ERROR0 ("client auth process not set"); LOG_ERROR("client auth process not set");
auth_client_free (auth_user); auth_client_free (auth_user);
...@@ -318,7 +318,7 @@ static void *auth_run_thread (void *arg) ...@@ -318,7 +318,7 @@ static void *auth_run_thread (void *arg)
} }
thread_sleep (150000); thread_sleep (150000);
} }
INFO0 ("Authenication thread shutting down"); LOG_INFO("Authenication thread shutting down");
return NULL; return NULL;
} }
...@@ -379,7 +379,7 @@ static int add_listener_to_source (source_t *source, client_t *client) ...@@ -379,7 +379,7 @@ static int add_listener_to_source (source_t *source, client_t *client)
int loop = 10; int loop = 10;
do do
{ {
DEBUG3 ("max on %s is %ld (cur %lu)", source->mount, LOG_DEBUG("max on %s is %ld (cur %lu)", source->mount,
source->max_listeners, source->listeners); source->max_listeners, source->listeners);
if (source->max_listeners == -1) if (source->max_listeners == -1)
break; break;
...@@ -390,12 +390,12 @@ static int add_listener_to_source (source_t *source, client_t *client) ...@@ -390,12 +390,12 @@ static int add_listener_to_source (source_t *source, client_t *client)
{ {
source_t *next = source_find_mount (source->fallback_mount); source_t *next = source_find_mount (source->fallback_mount);
if (!next) { if (!next) {
ERROR2("Fallback '%s' for full source '%s' not found", LOG_ERROR("Fallback '%s' for full source '%s' not found",
source->mount, source->fallback_mount); source->mount, source->fallback_mount);
return -1; return -1;
} }
INFO1 ("stream full trying %s", next->mount); LOG_INFO("stream full trying %s", next->mount);
source = next; source = next;
loop--; loop--;
continue; continue;
...@@ -418,10 +418,10 @@ static int add_listener_to_source (source_t *source, client_t *client) ...@@ -418,10 +418,10 @@ static int add_listener_to_source (source_t *source, client_t *client)
if (source->running == 0 && source->on_demand) if (source->running == 0 && source->on_demand)
{ {
/* enable on-demand relay to start, wake up the slave thread */ /* enable on-demand relay to start, wake up the slave thread */
DEBUG0("kicking off on-demand relay"); LOG_DEBUG("kicking off on-demand relay");
source->on_demand_req = 1; source->on_demand_req = 1;
} }
DEBUG1 ("Added client to %s", source->mount); LOG_DEBUG("Added client to %s", source->mount);
return 0; return 0;
} }
...@@ -442,7 +442,7 @@ static int add_authenticated_listener (const char *mount, mount_proxy *mountinfo ...@@ -442,7 +442,7 @@ static int add_authenticated_listener (const char *mount, mount_proxy *mountinfo
if (util_check_valid_extension (mount) == XSLT_CONTENT) if (util_check_valid_extension (mount) == XSLT_CONTENT)
{ {
/* If the file exists, then transform it, otherwise, write a 404 */ /* If the file exists, then transform it, otherwise, write a 404 */
DEBUG0("Stats request, sending XSL transformed stats"); LOG_DEBUG("Stats request, sending XSL transformed stats");
stats_transform_xslt (client, mount); stats_transform_xslt (client, mount);
return 0; return 0;
} }
...@@ -468,7 +468,7 @@ static int add_authenticated_listener (const char *mount, mount_proxy *mountinfo ...@@ -468,7 +468,7 @@ static int add_authenticated_listener (const char *mount, mount_proxy *mountinfo
ret = add_listener_to_source (source, client); ret = add_listener_to_source (source, client);
avl_tree_unlock (global.source_tree); avl_tree_unlock (global.source_tree);
if (ret == 0) if (ret == 0)
DEBUG0 ("client authenticated, passed to source"); LOG_DEBUG("client authenticated, passed to source");
} }
else else
{ {
...@@ -511,12 +511,12 @@ void auth_postprocess_source (auth_client *auth_user) ...@@ -511,12 +511,12 @@ void auth_postprocess_source (auth_client *auth_user)
client->authenticated = 1; client->authenticated = 1;
if (strcmp (req, "/admin.cgi") == 0 || strncmp ("/admin/metadata", req, 15) == 0) if (strcmp (req, "/admin.cgi") == 0 || strncmp ("/admin/metadata", req, 15) == 0)
{ {
DEBUG2 ("metadata request (%s, %s)", req, mount); LOG_DEBUG("metadata request (%s, %s)", req, mount);
admin_handle_request (client, "/admin/metadata"); admin_handle_request (client, "/admin/metadata");
} }
else else
{ {
DEBUG1 ("on mountpoint %s", mount); LOG_DEBUG("on mountpoint %s", mount);
source_startup (client, mount, 0); source_startup (client, mount, 0);
} }
} }
...@@ -544,13 +544,13 @@ void auth_add_listener (const char *mount, client_t *client) ...@@ -544,13 +544,13 @@ void auth_add_listener (const char *mount, client_t *client)
if (mountinfo->auth->pending_count > 100) if (mountinfo->auth->pending_count > 100)
{ {
config_release_config (); config_release_config ();
WARN0 ("too many clients awaiting authentication"); LOG_WARN("too many clients awaiting authentication");
client_send_403 (client, "busy, please try again later"); client_send_403 (client, "busy, please try again later");
return; return;
} }
auth_user = auth_client_setup (mount, client); auth_user = auth_client_setup (mount, client);
auth_user->process = auth_new_listener; auth_user->process = auth_new_listener;
INFO0 ("adding client for authentication"); LOG_INFO("adding client for authentication");
queue_auth_client (auth_user, mountinfo); queue_auth_client (auth_user, mountinfo);
config_release_config (); config_release_config ();
} }
...@@ -594,12 +594,12 @@ static int get_authenticator (auth_t *auth, config_options_t *options) ...@@ -594,12 +594,12 @@ static int get_authenticator (auth_t *auth, config_options_t *options)
{ {
if (auth->type == NULL) if (auth->type == NULL)
{ {
WARN0 ("no authentication type defined"); LOG_WARN("no authentication type defined");
return -1; return -1;
} }
do do
{ {
DEBUG1 ("type is %s", auth->type); LOG_DEBUG("type is %s", auth->type);
if (strcmp (auth->type, "url") == 0) if (strcmp (auth->type, "url") == 0)
{ {
...@@ -608,7 +608,7 @@ static int get_authenticator (auth_t *auth, config_options_t *options) ...@@ -608,7 +608,7 @@ static int get_authenticator (auth_t *auth, config_options_t *options)
return -1; return -1;
break; break;
#else #else
ERROR0 ("Auth URL disabled"); LOG_ERROR("Auth URL disabled");
return -1; return -1;
#endif #endif
} }
...@@ -619,7 +619,7 @@ static int get_authenticator (auth_t *auth, config_options_t *options) ...@@ -619,7 +619,7 @@ static int get_authenticator (auth_t *auth, config_options_t *options)
break; break;
} }
ERROR1("Unrecognised authenticator type: \"%s\"", auth->type); LOG_ERROR("Unrecognised authenticator type: \"%s\"", auth->type);
return -1; return -1;
} while (0); } while (0);
...@@ -668,7 +668,7 @@ auth_t *auth_get_authenticator (xmlNodePtr node) ...@@ -668,7 +668,7 @@ auth_t *auth_get_authenticator (xmlNodePtr node)
} }
else else
if (xmlStrcmp (current->name, XMLSTR("text")) != 0) if (xmlStrcmp (current->name, XMLSTR("text")) != 0)
WARN1 ("unknown auth setting (%s)", current->name); LOG_WARN("unknown auth setting (%s)", current->name);
} }
auth->type = (char*)xmlGetProp (node, XMLSTR("type")); auth->type = (char*)xmlGetProp (node, XMLSTR("type"));
if (get_authenticator (auth, options) < 0) if (get_authenticator (auth, options) < 0)
...@@ -709,7 +709,7 @@ int auth_stream_authenticate (client_t *client, const char *mount, mount_proxy * ...@@ -709,7 +709,7 @@ int auth_stream_authenticate (client_t *client, const char *mount, mount_proxy *
auth_client *auth_user = auth_client_setup (mount, client); auth_client *auth_user = auth_client_setup (mount, client);
auth_user->process = stream_auth_callback; auth_user->process = stream_auth_callback;
INFO1 ("request source auth for \"%s\"", mount); LOG_INFO("request source auth for \"%s\"", mount);
queue_auth_client (auth_user, mountinfo); queue_auth_client (auth_user, mountinfo);
return 1; return 1;
} }
...@@ -763,6 +763,6 @@ void auth_initialise (void) ...@@ -763,6 +763,6 @@ void auth_initialise (void)
void auth_shutdown (void) void auth_shutdown (void)
{ {
INFO0 ("Auth shutdown"); LOG_INFO("Auth shutdown");
} }
...@@ -115,7 +115,7 @@ static void htpasswd_recheckfile (htpasswd_auth_state *htpasswd) ...@@ -115,7 +115,7 @@ static void htpasswd_recheckfile (htpasswd_auth_state *htpasswd)
return; return;
if (stat (htpasswd->filename, &file_stat) < 0) if (stat (htpasswd->filename, &file_stat) < 0)
{ {
WARN1 ("failed to check status of %s", htpasswd->filename); LOG_WARN("failed to check status of %s", htpasswd->filename);
/* Create a dummy users tree for things to use later */ /* Create a dummy users tree for things to use later */
thread_rwlock_wlock (&htpasswd->file_rwlock); thread_rwlock_wlock (&htpasswd->file_rwlock);
...@@ -131,11 +131,11 @@ static void htpasswd_recheckfile (htpasswd_auth_state *htpasswd) ...@@ -131,11 +131,11 @@ static void htpasswd_recheckfile (htpasswd_auth_state *htpasswd)
/* common case, no update to file */ /* common case, no update to file */
return; return;
} }
INFO1 ("re-reading htpasswd file \"%s\"", htpasswd->filename); LOG_INFO("re-reading htpasswd file \"%s\"", htpasswd->filename);
passwdfile = fopen (htpasswd->filename, "rb"); passwdfile = fopen (htpasswd->filename, "rb");
if (passwdfile == NULL) if (passwdfile == NULL)
{ {
WARN2("Failed to open authentication database \"%s\": %s", LOG_WARN("Failed to open authentication database \"%s\": %s",
htpasswd->filename, strerror(errno)); htpasswd->filename, strerror(errno));
return; return;
} }
...@@ -155,7 +155,7 @@ static void htpasswd_recheckfile (htpasswd_auth_state *htpasswd) ...@@ -155,7 +155,7 @@ static void htpasswd_recheckfile (htpasswd_auth_state *htpasswd)
sep = strrchr (line, ':'); sep = strrchr (line, ':');
if (sep == NULL) if (sep == NULL)
{ {
WARN2("No separator on line %d (%s)", num, htpasswd->filename); LOG_WARN("No separator on line %d (%s)", num, htpasswd->filename);
continue; continue;
} }
entry = calloc (1, sizeof (htpasswd_user)); entry = calloc (1, sizeof (htpasswd_user));
...@@ -189,7 +189,7 @@ static auth_result htpasswd_auth (auth_client *auth_user) ...@@ -189,7 +189,7 @@ static auth_result htpasswd_auth (auth_client *auth_user)
if (htpasswd->filename == NULL) if (htpasswd->filename == NULL)
{ {
ERROR0("No filename given in options for authenticator."); LOG_ERROR("No filename given in options for authenticator.");
return AUTH_FAILED; return AUTH_FAILED;
} }
htpasswd_recheckfile (htpasswd); htpasswd_recheckfile (htpasswd);
...@@ -209,10 +209,10 @@ static auth_result htpasswd_auth (auth_client *auth_user) ...@@ -209,10 +209,10 @@ static auth_result htpasswd_auth (auth_client *auth_user)
return AUTH_OK; return AUTH_OK;
} }
free (hashed_pw); free (hashed_pw);
DEBUG0 ("incorrect password for client"); LOG_DEBUG("incorrect password for client");
return AUTH_FAILED; return AUTH_FAILED;
} }
DEBUG1 ("no such username: %s", client->username); LOG_DEBUG("no such username: %s", client->username);
thread_rwlock_unlock (&htpasswd->file_rwlock); thread_rwlock_unlock (&htpasswd->file_rwlock);
return AUTH_FAILED; return AUTH_FAILED;
} }
...@@ -240,10 +240,10 @@ int auth_get_htpasswd_auth (auth_t *authenticator, config_options_t *options) ...@@ -240,10 +240,10 @@ int auth_get_htpasswd_auth (auth_t *authenticator, config_options_t *options)
} }
if (state->filename) if (state->filename)
INFO1("Configured htpasswd authentication using password file \"%s\"", LOG_INFO("Configured htpasswd authentication using password file \"%s\"",
state->filename); state->filename);
else else
ERROR0("No filename given in options for authenticator."); LOG_ERROR("No filename given in options for authenticator.");
authenticator->state = state; authenticator->state = state;
...@@ -278,7 +278,7 @@ static auth_result htpasswd_adduser (auth_t *auth, const char *username, const c ...@@ -278,7 +278,7 @@ static auth_result htpasswd_adduser (auth_t *auth, const char *username, const c
if (passwdfile == NULL) if (passwdfile == NULL)
{ {
thread_rwlock_unlock (&state->file_rwlock); thread_rwlock_unlock (&state->file_rwlock);
WARN2("Failed to open authentication database \"%s\": %s", LOG_WARN("Failed to open authentication database \"%s\": %s",
state->filename, strerror(errno)); state->filename, strerror(errno));
return AUTH_FAILED; return AUTH_FAILED;
} }
...@@ -312,7 +312,7 @@ static auth_result htpasswd_deleteuser(auth_t *auth, const char *username) ...@@ -312,7 +312,7 @@ static auth_result htpasswd_deleteuser(auth_t *auth, const char *username)
passwdfile = fopen(state->filename, "rb"); passwdfile = fopen(state->filename, "rb");
if(passwdfile == NULL) { if(passwdfile == NULL) {
WARN2("Failed to open authentication database \"%s\": %s", LOG_WARN("Failed to open authentication database \"%s\": %s",
state->filename, strerror(errno)); state->filename, strerror(errno));
thread_rwlock_unlock (&state->file_rwlock); thread_rwlock_unlock (&state->file_rwlock);
return AUTH_FAILED; return AUTH_FAILED;
...@@ -322,7 +322,7 @@ static auth_result htpasswd_deleteuser(auth_t *auth, const char *username) ...@@ -322,7 +322,7 @@ static auth_result htpasswd_deleteuser(auth_t *auth, const char *username)
snprintf (tmpfile, tmpfile_len, "%s.tmp", state->filename); snprintf (tmpfile, tmpfile_len, "%s.tmp", state->filename);
if (stat (tmpfile, &file_info) == 0) if (stat (tmpfile, &file_info) == 0)
{ {
WARN1 ("temp file \"%s\" exists, rejecting operation", tmpfile); LOG_WARN("temp file \"%s\" exists, rejecting operation", tmpfile);
free (tmpfile); free (tmpfile);
fclose (passwdfile); fclose (passwdfile);
thread_rwlock_unlock (&state->file_rwlock); thread_rwlock_unlock (&state->file_rwlock);
...@@ -332,7 +332,7 @@ static auth_result htpasswd_deleteuser(auth_t *auth, const char *username) ...@@ -332,7 +332,7 @@ static auth_result htpasswd_deleteuser(auth_t *auth, const char *username)
tmp_passwdfile = fopen(tmpfile, "wb"); tmp_passwdfile = fopen(tmpfile, "wb");
if(tmp_passwdfile == NULL) { if(tmp_passwdfile == NULL) {
WARN2("Failed to open temporary authentication database \"%s\": %s", LOG_WARN("Failed to open temporary authentication database \"%s\": %s",
tmpfile, strerror(errno)); tmpfile, strerror(errno));
fclose(passwdfile); fclose(passwdfile);
free(tmpfile); free(tmpfile);
...@@ -347,7 +347,7 @@ static auth_result htpasswd_deleteuser(auth_t *auth, const char *username) ...@@ -347,7 +347,7 @@ static auth_result htpasswd_deleteuser(auth_t *auth, const char *username)
sep = strchr(line, ':'); sep = strchr(line, ':');
if(sep == NULL) { if(sep == NULL) {
DEBUG0("No separator in line"); LOG_DEBUG("No separator in line");
continue; continue;
} }
...@@ -367,12 +367,12 @@ static auth_result htpasswd_deleteuser(auth_t *auth, const char *username) ...@@ -367,12 +367,12 @@ static auth_result htpasswd_deleteuser(auth_t *auth, const char *username)
/* Windows won't let us rename a file if the destination file /* Windows won't let us rename a file if the destination file
exists...so, lets remove the original first */ exists...so, lets remove the original first */
if (remove(state->filename) != 0) { if (remove(state->filename) != 0) {
ERROR3("Problem moving temp authentication file to original \"%s\" - \"%s\": %s", LOG_ERROR("Problem moving temp authentication file to original \"%s\" - \"%s\": %s",
tmpfile, state->filename, strerror(errno)); tmpfile, state->filename, strerror(errno));
} }
else { else {
if (rename(tmpfile, state->filename) != 0) { if (rename(tmpfile, state->filename) != 0) {
ERROR3("Problem moving temp authentication file to original \"%s\" - \"%s\": %s", LOG_ERROR("Problem moving temp authentication file to original \"%s\" - \"%s\": %s",
tmpfile, state->filename, strerror(errno)); tmpfile, state->filename, strerror(errno));
} }
} }
......
...@@ -109,7 +109,7 @@ static void auth_url_clear(auth_t *self) ...@@ -109,7 +109,7 @@ static void auth_url_clear(auth_t *self)
{ {
auth_url *url; auth_url *url;
INFO0 ("Doing auth URL cleanup"); LOG_INFO("Doing auth URL cleanup");
url = self->state; url = self->state;
self->state = NULL; self->state = NULL;
curl_easy_cleanup (url->handle); curl_easy_cleanup (url->handle);
...@@ -263,7 +263,7 @@ static auth_result url_remove_listener (auth_client *auth_user) ...@@ -263,7 +263,7 @@ static auth_result url_remove_listener (auth_client *auth_user)
curl_easy_setopt (url->handle, CURLOPT_WRITEHEADER, auth_user); curl_easy_setopt (url->handle, CURLOPT_WRITEHEADER, auth_user);
if (curl_easy_perform (url->handle)) if (curl_easy_perform (url->handle))
WARN2 ("auth to server %s failed with %s", url->removeurl, url->errormsg); LOG_WARN("auth to server %s failed with %s", url->removeurl, url->errormsg);
free (userpwd); free (userpwd);
...@@ -394,13 +394,13 @@ static auth_result url_add_listener (auth_client *auth_user) ...@@ -394,13 +394,13 @@ static auth_result url_add_listener (auth_client *auth_user)
if (res) if (res)
{ {
WARN2 ("auth to server %s failed with %s", url->addurl, url->errormsg); LOG_WARN("auth to server %s failed with %s", url->addurl, url->errormsg);
return AUTH_FAILED; return AUTH_FAILED;
} }
/* we received a response, lets see what it is */ /* we received a response, lets see what it is */
if (client->authenticated) if (client->authenticated)
return AUTH_OK; return AUTH_OK;
INFO2 ("client auth (%s) failed with \"%s\"", url->addurl, url->errormsg); LOG_INFO("client auth (%s) failed with \"%s\"", url->addurl, url->errormsg);
return AUTH_FAILED; return AUTH_FAILED;
} }
...@@ -452,7 +452,7 @@ static void url_stream_start (auth_client *auth_user) ...@@ -452,7 +452,7 @@ static void url_stream_start (auth_client *auth_user)
curl_easy_setopt (url->handle, CURLOPT_WRITEHEADER, auth_user); curl_easy_setopt (url->handle, CURLOPT_WRITEHEADER, auth_user);
if (curl_easy_perform (url->handle)) if (curl_easy_perform (url->handle))
WARN2 ("auth to server %s failed with %s", stream_start_url, url->errormsg); LOG_WARN("auth to server %s failed with %s", stream_start_url, url->errormsg);
auth_release (auth); auth_release (auth);
free (stream_start_url); free (stream_start_url);
...@@ -504,7 +504,7 @@ static void url_stream_end (auth_client *auth_user) ...@@ -504,7 +504,7 @@ static void url_stream_end (auth_client *auth_user)
curl_easy_setopt (url->handle, CURLOPT_WRITEHEADER, auth_user); curl_easy_setopt (url->handle, CURLOPT_WRITEHEADER, auth_user);
if (curl_easy_perform (url->handle)) if (curl_easy_perform (url->handle))
WARN2 ("auth to server %s failed with %s", stream_end_url, url->errormsg); LOG_WARN("auth to server %s failed with %s", stream_end_url, url->errormsg);
auth_release (auth); auth_release (auth);
free (stream_end_url); free (stream_end_url);
...@@ -554,7 +554,7 @@ static void url_stream_auth (auth_client *auth_user) ...@@ -554,7 +554,7 @@ static void url_stream_auth (auth_client *auth_user)
client->authenticated = 0; client->authenticated = 0;
if (curl_easy_perform (url->handle)) if (curl_easy_perform (url->handle))
WARN2 ("auth to server %s failed with %s", url->stream_auth, url->errormsg); LOG_WARN("auth to server %s failed with %s", url->stream_auth, url->errormsg);
} }
...@@ -683,7 +683,7 @@ int auth_get_url_auth (auth_t *authenticator, config_options_t *options) ...@@ -683,7 +683,7 @@ int auth_get_url_auth (auth_t *authenticator, config_options_t *options)
snprintf (url_info->userpwd, len, "%s:%s", url_info->username, url_info->password); snprintf (url_info->userpwd, len, "%s:%s", url_info->username, url_info->password);
} }
INFO0("URL based authentication setup"); LOG_INFO("URL based authentication setup");
return 0; return 0;
} }
...@@ -417,7 +417,7 @@ static void _parse_root(xmlDocPtr doc, xmlNodePtr node, ...@@ -417,7 +417,7 @@ static void _parse_root(xmlDocPtr doc, xmlNodePtr node,
_parse_authentication(doc, node->xmlChildrenNode, configuration); _parse_authentication(doc, node->xmlChildrenNode, configuration);
} else if (xmlStrcmp (node->name, XMLSTR("source-password")) == 0) { } else if (xmlStrcmp (node->name, XMLSTR("source-password")) == 0) {
/* TODO: This is the backwards-compatibility location */ /* TODO: This is the backwards-compatibility location */
WARN0("<source-password> defined outside <authentication>. This is deprecated."); LOG_WARN("<source-password> defined outside <authentication>. This is deprecated.");
if (configuration->source_password) xmlFree(configuration->source_password); if (configuration->source_password) xmlFree(configuration->source_password);
configuration->source_password = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1); configuration->source_password = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
} else if (xmlStrcmp (node->name, XMLSTR("icelogin")) == 0) { } else if (xmlStrcmp (node->name, XMLSTR("icelogin")) == 0) {
...@@ -572,7 +572,7 @@ static void _parse_mount(xmlDocPtr doc, xmlNodePtr node, ...@@ -572,7 +572,7 @@ static void _parse_mount(xmlDocPtr doc, xmlNodePtr node,
mount->mounttype = MOUNT_TYPE_DEFAULT; mount->mounttype = MOUNT_TYPE_DEFAULT;
} }
else { else {
WARN1("Unknown mountpoint type: %s", tmp); LOG_WARN("Unknown mountpoint type: %s", tmp);
config_clear_mount (mount); config_clear_mount (mount);
return; return;
} }
...@@ -718,7 +718,7 @@ static void _parse_mount(xmlDocPtr doc, xmlNodePtr node, ...@@ -718,7 +718,7 @@ static void _parse_mount(xmlDocPtr doc, xmlNodePtr node,
} }
else if (mount->mountname != NULL && mount->mounttype == MOUNT_TYPE_DEFAULT) else if (mount->mountname != NULL && mount->mounttype == MOUNT_TYPE_DEFAULT)
{ {
WARN1("Default mount %s has mount-name set. This is not supported. Behavior may not be consistent.", mount->mountname); LOG_WARN("Default mount %s has mount-name set. This is not supported. Behavior may not be consistent.", mount->mountname);
} }
if (mount->auth) if (mount->auth)
mount->auth->mount = strdup ((char *)mount->mountname); mount->auth->mount = strdup ((char *)mount->mountname);
...@@ -729,7 +729,7 @@ static void _parse_mount(xmlDocPtr doc, xmlNodePtr node, ...@@ -729,7 +729,7 @@ static void _parse_mount(xmlDocPtr doc, xmlNodePtr node,
if (!mount->fallback_mount && (mount->fallback_when_full || mount->fallback_override)) if (!mount->fallback_mount && (mount->fallback_when_full || mount->fallback_override))
{ {
WARN1("Config for mount %s contains fallback options but no fallback mount.", mount->mountname); LOG_WARN("Config for mount %s contains fallback options but no fallback mount.", mount->mountname);
} }
if(last) if(last)
...@@ -893,7 +893,7 @@ static void _parse_authentication(xmlDocPtr doc, xmlNodePtr node, ...@@ -893,7 +893,7 @@ static void _parse_authentication(xmlDocPtr doc, xmlNodePtr node,
if (xmlStrcmp (node->name, XMLSTR("source-password")) == 0) { if (xmlStrcmp (node->name, XMLSTR("source-password")) == 0) {
if (xmlGetProp(node, XMLSTR("mount"))) { if (xmlGetProp(node, XMLSTR("mount"))) {
ERROR0("Mount level source password defined within global <authentication> section."); LOG_ERROR("Mount level source password defined within global <authentication> section.");
} }
else { else {
if (configuration->source_password) if (configuration->source_password)
...@@ -931,7 +931,7 @@ static void _parse_directory(xmlDocPtr doc, xmlNodePtr node, ...@@ -931,7 +931,7 @@ static void _parse_directory(xmlDocPtr doc, xmlNodePtr node,
char *tmp; char *tmp;
if (configuration->num_yp_directories >= MAX_YP_DIRECTORIES) {