mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2024-09-29 04:25:55 -04:00
minor cleanup on source shutdown. check for per-mount auth settings if admin
auth not provided on mount-based admin requests. svn path=/icecast/branches/kh/icecast/; revision=8004
This commit is contained in:
parent
6f7bf1218d
commit
d40b6b88ea
28
src/admin.c
28
src/admin.c
@ -289,7 +289,6 @@ void admin_handle_request(client_t *client, char *uri)
|
||||
{
|
||||
char *mount, *command_string;
|
||||
int command;
|
||||
int noauth = 0;
|
||||
|
||||
if(strncmp("/admin/", uri, 7)) {
|
||||
ERROR0("Internal error: admin request isn't");
|
||||
@ -315,18 +314,12 @@ void admin_handle_request(client_t *client, char *uri)
|
||||
source_t *source;
|
||||
|
||||
if (command == COMMAND_BUILDM3U) {
|
||||
noauth = 1;
|
||||
client->authenticated = 1;
|
||||
}
|
||||
/* This is a mount request, handle it as such */
|
||||
if (!noauth) {
|
||||
if(!connection_check_admin_pass(client->parser)) {
|
||||
if(!connection_check_source_pass(client->parser, mount)) {
|
||||
INFO1("Bad or missing password on mount modification admin "
|
||||
"request (command: %s)", command_string);
|
||||
client_send_401(client);
|
||||
return;
|
||||
}
|
||||
}
|
||||
/* This is a mount request, but admin user is allowed */
|
||||
if (client->authenticated != 1) {
|
||||
if (connection_check_admin_pass(client->parser))
|
||||
client->authenticated = 1;
|
||||
}
|
||||
|
||||
avl_tree_rlock(global.source_tree);
|
||||
@ -351,6 +344,17 @@ void admin_handle_request(client_t *client, char *uri)
|
||||
}
|
||||
INFO2("Received admin command %s on mount \"%s\"",
|
||||
command_string, mount);
|
||||
if (client->authenticated != 1)
|
||||
{
|
||||
if (connection_check_source_pass(client->parser, mount) == 0)
|
||||
{
|
||||
INFO1("Bad or missing password on mount modification admin "
|
||||
"request (command: %s)", command_string);
|
||||
avl_tree_unlock(global.source_tree);
|
||||
client_send_401(client);
|
||||
return;
|
||||
}
|
||||
}
|
||||
admin_handle_mount_request (client, source, command);
|
||||
avl_tree_unlock(global.source_tree);
|
||||
}
|
||||
|
@ -170,6 +170,8 @@ void format_vorbis_free_plugin (format_plugin_t *plugin)
|
||||
refbuf_release (to_go);
|
||||
}
|
||||
|
||||
free (state->url_artist);
|
||||
free (state->url_title);
|
||||
ogg_packet_clear (&state->url_comment);
|
||||
|
||||
free (state);
|
||||
|
Loading…
Reference in New Issue
Block a user