[xiph-commits] r15264 - icecast/trunk/icecast/src

karl at svn.xiph.org karl at svn.xiph.org
Sun Sep 7 17:30:37 PDT 2008


Author: karl
Date: 2008-09-07 17:30:37 -0700 (Sun, 07 Sep 2008)
New Revision: 15264

Modified:
   icecast/trunk/icecast/src/admin.c
Log:
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.


Modified: icecast/trunk/icecast/src/admin.c
===================================================================
--- icecast/trunk/icecast/src/admin.c	2008-09-08 00:22:37 UTC (rev 15263)
+++ icecast/trunk/icecast/src/admin.c	2008-09-08 00:30:37 UTC (rev 15264)
@@ -887,6 +887,7 @@
     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 @@
     }
 
     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 @@
 {
     const char *action;
     const char *value;
+    int same_ip = 1;
 
     DEBUG0("Got shoutcast metadata update request");
 
@@ -963,8 +968,11 @@
         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);
 



More information about the commits mailing list