[xiph-commits] r8004 - icecast/branches/kh/icecast/src

karl at motherfish-iii.xiph.org karl at motherfish-iii.xiph.org
Thu Oct 14 19:34:38 PDT 2004


Author: karl
Date: 2004-10-14 19:34:38 -0700 (Thu, 14 Oct 2004)
New Revision: 8004

Modified:
   icecast/branches/kh/icecast/src/admin.c
   icecast/branches/kh/icecast/src/format_vorbis.c
Log:
minor cleanup on source shutdown. check for per-mount auth settings if admin
auth not provided on mount-based admin requests.


Modified: icecast/branches/kh/icecast/src/admin.c
===================================================================
--- icecast/branches/kh/icecast/src/admin.c	2004-10-15 00:45:39 UTC (rev 8003)
+++ icecast/branches/kh/icecast/src/admin.c	2004-10-15 02:34:38 UTC (rev 8004)
@@ -289,7 +289,6 @@
 {
     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 @@
         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 @@
             }
             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);
         }

Modified: icecast/branches/kh/icecast/src/format_vorbis.c
===================================================================
--- icecast/branches/kh/icecast/src/format_vorbis.c	2004-10-15 00:45:39 UTC (rev 8003)
+++ icecast/branches/kh/icecast/src/format_vorbis.c	2004-10-15 02:34:38 UTC (rev 8004)
@@ -170,6 +170,8 @@
         refbuf_release (to_go);
     }
 
+    free (state->url_artist);
+    free (state->url_title);
     ogg_packet_clear (&state->url_comment);
 
     free (state);



More information about the commits mailing list