mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2024-11-03 04:17:17 -05:00
Allow buildm3u to work with the mount given, no need to check the source tree. closes #866
svn path=/icecast/trunk/icecast/; revision=13908
This commit is contained in:
parent
b8ab793867
commit
43988cac59
27
src/admin.c
27
src/admin.c
@ -183,8 +183,7 @@ static void command_kill_client(client_t *client, source_t *source,
|
|||||||
int response);
|
int response);
|
||||||
static void command_manageauth(client_t *client, source_t *source,
|
static void command_manageauth(client_t *client, source_t *source,
|
||||||
int response);
|
int response);
|
||||||
static void command_buildm3u(client_t *client, source_t *source,
|
static void command_buildm3u(client_t *client, const char *mount);
|
||||||
int response);
|
|
||||||
static void command_kill_source(client_t *client, source_t *source,
|
static void command_kill_source(client_t *client, source_t *source,
|
||||||
int response);
|
int response);
|
||||||
static void command_updatemetadata(client_t *client, source_t *source,
|
static void command_updatemetadata(client_t *client, source_t *source,
|
||||||
@ -307,7 +306,6 @@ void admin_handle_request(client_t *client, const char *uri)
|
|||||||
{
|
{
|
||||||
const char *mount, *command_string;
|
const char *mount, *command_string;
|
||||||
int command;
|
int command;
|
||||||
int noauth = 0;
|
|
||||||
|
|
||||||
DEBUG1("Admin request (%s)", uri);
|
DEBUG1("Admin request (%s)", uri);
|
||||||
if (!((strcmp(uri, "/admin.cgi") == 0) ||
|
if (!((strcmp(uri, "/admin.cgi") == 0) ||
|
||||||
@ -355,20 +353,23 @@ void admin_handle_request(client_t *client, const char *uri)
|
|||||||
if(mount != NULL) {
|
if(mount != NULL) {
|
||||||
source_t *source;
|
source_t *source;
|
||||||
|
|
||||||
if (command == COMMAND_BUILDM3U) {
|
/* this request does not require auth but can apply to files on webroot */
|
||||||
noauth = 1;
|
if (command == COMMAND_BUILDM3U)
|
||||||
|
{
|
||||||
|
command_buildm3u (client, mount);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
/* This is a mount request, handle it as such */
|
/* This is a mount request, handle it as such */
|
||||||
if (!noauth) {
|
if (!connection_check_admin_pass(client->parser))
|
||||||
if(!connection_check_admin_pass(client->parser)) {
|
{
|
||||||
if(!connection_check_source_pass(client->parser, mount)) {
|
if (!connection_check_source_pass(client->parser, mount))
|
||||||
|
{
|
||||||
INFO1("Bad or missing password on mount modification admin "
|
INFO1("Bad or missing password on mount modification admin "
|
||||||
"request (command: %s)", command_string);
|
"request (command: %s)", command_string);
|
||||||
client_send_401(client);
|
client_send_401(client);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
avl_tree_rlock(global.source_tree);
|
avl_tree_rlock(global.source_tree);
|
||||||
source = source_find_mount_raw(mount);
|
source = source_find_mount_raw(mount);
|
||||||
@ -526,9 +527,6 @@ static void admin_handle_mount_request(client_t *client, source_t *source,
|
|||||||
case COMMAND_RAW_UPDATEMETADATA:
|
case COMMAND_RAW_UPDATEMETADATA:
|
||||||
command_updatemetadata(client, source, RAW);
|
command_updatemetadata(client, source, RAW);
|
||||||
break;
|
break;
|
||||||
case COMMAND_BUILDM3U:
|
|
||||||
command_buildm3u(client, source, RAW);
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
WARN0("Mount request not recognised");
|
WARN0("Mount request not recognised");
|
||||||
client_send_400(client, "Mount request unknown");
|
client_send_400(client, "Mount request unknown");
|
||||||
@ -674,8 +672,7 @@ static void command_show_listeners(client_t *client, source_t *source,
|
|||||||
xmlFreeDoc(doc);
|
xmlFreeDoc(doc);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void command_buildm3u(client_t *client, source_t *source,
|
static void command_buildm3u(client_t *client, const char *mount)
|
||||||
int response)
|
|
||||||
{
|
{
|
||||||
const char *username = NULL;
|
const char *username = NULL;
|
||||||
const char *password = NULL;
|
const char *password = NULL;
|
||||||
@ -695,7 +692,7 @@ static void command_buildm3u(client_t *client, source_t *source,
|
|||||||
password,
|
password,
|
||||||
config->hostname,
|
config->hostname,
|
||||||
config->port,
|
config->port,
|
||||||
source->mount
|
mount
|
||||||
);
|
);
|
||||||
config_release_config();
|
config_release_config();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user