1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2025-02-02 15:07:36 -05:00

Fix: Corrected display of "login" on status page

This corrects the creation of <authenticator> in the status output
and this way fixes the display of login link on status page.
Closes #1939
This commit is contained in:
Philipp Schafft 2014-12-20 09:39:26 +00:00
parent 3d6ea2efdb
commit 55d429a6c8
4 changed files with 8 additions and 8 deletions

View File

@ -253,9 +253,9 @@ xmlDocPtr admin_build_sourcelist (const char *mount)
config = config_get_config();
mountinfo = config_find_mount (config, source->mount, MOUNT_TYPE_NORMAL);
if (mountinfo)
acl = auth_stack_get_anonymous_acl(mountinfo->authstack);
acl = auth_stack_get_anonymous_acl(mountinfo->authstack, httpp_req_get);
if (!acl)
auth_stack_get_anonymous_acl(config->authstack);
acl = auth_stack_get_anonymous_acl(config->authstack, httpp_req_get);
if (acl && acl_test_web(acl) == ACL_POLICY_DENY) {
xmlNewChild(srcnode, NULL, XMLSTR("authenticator"), XMLSTR("(dummy)"));
}

View File

@ -727,17 +727,17 @@ auth_t *auth_stack_getbyid(auth_stack_t *stack, unsigned long id) {
}
acl_t *auth_stack_get_anonymous_acl(auth_stack_t *stack) {
acl_t *auth_stack_get_anonymous_acl(auth_stack_t *stack, httpp_request_type_e method) {
acl_t *ret = NULL;
if (!stack)
if (!stack || method < 0 || method > httpp_req_unknown)
return NULL;
auth_stack_addref(stack);
while (!ret && stack) {
auth_t *auth = auth_stack_get(stack);
if (strcmp(auth->type, AUTH_TYPE_ANONYMOUS) == 0) {
if (auth->method[method] && strcmp(auth->type, AUTH_TYPE_ANONYMOUS) == 0) {
acl_addref(ret = auth->acl);
}
auth_release(auth);

View File

@ -135,6 +135,6 @@ int auth_stack_push(auth_stack_t **stack, auth_t *auth);
int auth_stack_append(auth_stack_t *stack, auth_stack_t *tail);
auth_t *auth_stack_get(auth_stack_t *stack);
auth_t *auth_stack_getbyid(auth_stack_t *stack, unsigned long id);
acl_t *auth_stack_get_anonymous_acl(auth_stack_t *stack);
acl_t *auth_stack_get_anonymous_acl(auth_stack_t *stack, httpp_request_type_e method);
#endif

View File

@ -1118,9 +1118,9 @@ static void source_apply_mount (ice_config_t *config, source_t *source, mount_pr
stats_event (source->mount, "subtype", mountinfo->subtype);
if (mountinfo)
acl = auth_stack_get_anonymous_acl(mountinfo->authstack);
acl = auth_stack_get_anonymous_acl(mountinfo->authstack, httpp_req_get);
if (!acl)
auth_stack_get_anonymous_acl(config->authstack);
acl = auth_stack_get_anonymous_acl(config->authstack, httpp_req_get);
if (acl && acl_test_web(acl) == ACL_POLICY_DENY)
stats_event (source->mount, "authenticator", "(dummy)");
else