Commit 4c841bbe authored by Karl Heyes's avatar Karl Heyes

only allow raw admin metadata updates from the IP of the source client unless

the user is admin. It seems that some source clients issue metadata updates
even if they are rejected due to the mountpoint being in use.

svn path=/icecast/trunk/icecast/; revision=15264
parent 30836f31
......@@ -887,6 +887,7 @@ static void command_metadata(client_t *client, source_t *source,
format_plugin_t *plugin;
xmlDocPtr doc;
xmlNodePtr node;
int same_ip = 1;
doc = xmlNewDoc (XMLSTR("1.0"));
node = xmlNewDocNode (doc, NULL, XMLSTR("iceresponse"), NULL);
......@@ -911,8 +912,11 @@ static void command_metadata(client_t *client, source_t *source,
}
plugin = source->format;
if (source->client && strcmp (client->con->ip, source->client->con->ip) != 0)
if (response == RAW && connection_check_admin_pass (client->parser) == 0)
same_ip = 0;
if (plugin && plugin->set_tag)
if (same_ip && plugin && plugin->set_tag)
{
if (song)
{
......@@ -952,6 +956,7 @@ static void command_shoutcast_metadata(client_t *client, source_t *source)
{
const char *action;
const char *value;
int same_ip = 1;
DEBUG0("Got shoutcast metadata update request");
......@@ -963,8 +968,11 @@ static void command_shoutcast_metadata(client_t *client, source_t *source)
client_send_400 (client, "No such action");
return;
}
if (source->client && strcmp (client->con->ip, source->client->con->ip) != 0)
if (connection_check_admin_pass (client->parser) == 0)
same_ip = 0;
if (source->format && source->format->set_tag)
if (same_ip && source->format && source->format->set_tag)
{
source->format->set_tag (source->format, "title", value, NULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment