Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Icecast-Server
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
94
Issues
94
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
External Wiki
External Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xiph.Org
Icecast-Server
Commits
ed266a5d
Commit
ed266a5d
authored
Sep 13, 2018
by
Philipp Schafft
🦁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Feature: Added per <listen-socket> <authentication>
parent
1f8d19cb
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
2 deletions
+51
-2
src/cfgfile.c
src/cfgfile.c
+18
-0
src/cfgfile.h
src/cfgfile.h
+1
-0
src/connection.c
src/connection.c
+32
-2
No files found.
src/cfgfile.c
View file @
ed266a5d
...
@@ -616,6 +616,7 @@ listener_t *config_clear_listener(listener_t *listener)
...
@@ -616,6 +616,7 @@ listener_t *config_clear_listener(listener_t *listener)
if
(
listener
->
on_behalf_of
)
free
(
listener
->
on_behalf_of
);
if
(
listener
->
on_behalf_of
)
free
(
listener
->
on_behalf_of
);
if
(
listener
->
bind_address
)
xmlFree
(
listener
->
bind_address
);
if
(
listener
->
bind_address
)
xmlFree
(
listener
->
bind_address
);
if
(
listener
->
shoutcast_mount
)
xmlFree
(
listener
->
shoutcast_mount
);
if
(
listener
->
shoutcast_mount
)
xmlFree
(
listener
->
shoutcast_mount
);
if
(
listener
->
authstack
)
auth_stack_release
(
listener
->
authstack
);
free
(
listener
);
free
(
listener
);
}
}
return
next
;
return
next
;
...
@@ -1893,6 +1894,19 @@ static void _parse_listen_socket(xmlDocPtr doc,
...
@@ -1893,6 +1894,19 @@ static void _parse_listen_socket(xmlDocPtr doc,
node
->
xmlChildrenNode
,
1
);
node
->
xmlChildrenNode
,
1
);
}
else
if
(
xmlStrcmp
(
node
->
name
,
XMLSTR
(
"so-sndbuf"
))
==
0
)
{
}
else
if
(
xmlStrcmp
(
node
->
name
,
XMLSTR
(
"so-sndbuf"
))
==
0
)
{
__read_int
(
doc
,
node
,
&
listener
->
so_sndbuf
,
"<so-sndbuf> must not be empty."
);
__read_int
(
doc
,
node
,
&
listener
->
so_sndbuf
,
"<so-sndbuf> must not be empty."
);
}
else
if
(
xmlStrcmp
(
node
->
name
,
XMLSTR
(
"authentication"
))
==
0
)
{
xmlNodePtr
child
=
node
->
xmlChildrenNode
;
do
{
if
(
child
==
NULL
)
break
;
if
(
xmlIsBlankNode
(
child
))
continue
;
if
(
xmlStrcmp
(
child
->
name
,
XMLSTR
(
"role"
))
==
0
)
{
auth_t
*
auth
=
auth_get_authenticator
(
child
);
auth_stack_push
(
&
(
listener
->
authstack
),
auth
);
auth_release
(
auth
);
}
}
while
((
child
=
child
->
next
));
}
}
}
while
((
node
=
node
->
next
));
}
while
((
node
=
node
->
next
));
...
@@ -2613,5 +2627,9 @@ listener_t *config_copy_listener_one(const listener_t *listener) {
...
@@ -2613,5 +2627,9 @@ listener_t *config_copy_listener_one(const listener_t *listener) {
n
->
shoutcast_mount
=
(
char
*
)
xmlStrdup
(
XMLSTR
(
listener
->
shoutcast_mount
));
n
->
shoutcast_mount
=
(
char
*
)
xmlStrdup
(
XMLSTR
(
listener
->
shoutcast_mount
));
n
->
tls
=
listener
->
tls
;
n
->
tls
=
listener
->
tls
;
if
(
listener
->
authstack
)
{
auth_stack_addref
(
n
->
authstack
=
listener
->
authstack
);
}
return
n
;
return
n
;
}
}
src/cfgfile.h
View file @
ed266a5d
...
@@ -165,6 +165,7 @@ typedef struct _listener_t {
...
@@ -165,6 +165,7 @@ typedef struct _listener_t {
int
shoutcast_compat
;
int
shoutcast_compat
;
char
*
shoutcast_mount
;
char
*
shoutcast_mount
;
tlsmode_t
tls
;
tlsmode_t
tls
;
auth_stack_t
*
authstack
;
}
listener_t
;
}
listener_t
;
typedef
struct
_config_tls_context
{
typedef
struct
_config_tls_context
{
...
...
src/connection.c
View file @
ed266a5d
...
@@ -1411,16 +1411,46 @@ static void _handle_authentication_mount_default(client_t *client, void *uri, au
...
@@ -1411,16 +1411,46 @@ static void _handle_authentication_mount_default(client_t *client, void *uri, au
_handle_authentication_mount_generic
(
client
,
uri
,
MOUNT_TYPE_DEFAULT
,
_handle_authentication_global
);
_handle_authentication_mount_generic
(
client
,
uri
,
MOUNT_TYPE_DEFAULT
,
_handle_authentication_global
);
}
}
static
void
_handle_authentication_mount_normal
(
client_t
*
client
,
char
*
uri
)
static
void
_handle_authentication_mount_normal
(
client_t
*
client
,
void
*
uri
,
auth_result
result
)
{
{
auth_stack_release
(
client
->
authstack
);
client
->
authstack
=
NULL
;
if
(
result
!=
AUTH_NOMATCH
&&
!
(
result
==
AUTH_OK
&&
client
->
admin_command
!=
ADMIN_COMMAND_ERROR
&&
acl_test_admin
(
client
->
acl
,
client
->
admin_command
)
==
ACL_POLICY_DENY
))
{
_handle_authed_client
(
client
,
uri
,
result
);
return
;
}
ICECAST_LOG_DEBUG
(
"Trying <mount type=
\"
normal
\"
> specific authenticators for client %p."
,
client
);
ICECAST_LOG_DEBUG
(
"Trying <mount type=
\"
normal
\"
> specific authenticators for client %p."
,
client
);
_handle_authentication_mount_generic
(
client
,
uri
,
MOUNT_TYPE_NORMAL
,
_handle_authentication_mount_default
);
_handle_authentication_mount_generic
(
client
,
uri
,
MOUNT_TYPE_NORMAL
,
_handle_authentication_mount_default
);
}
}
static
void
_handle_authentication_listen_socket
(
client_t
*
client
,
char
*
uri
)
{
auth_stack_t
*
stack
=
NULL
;
const
listener_t
*
listener
;
listener
=
listensocket_get_listener
(
client
->
con
->
listensocket_effective
);
if
(
listener
)
{
if
(
listener
->
authstack
)
{
auth_stack_addref
(
stack
=
listener
->
authstack
);
}
listensocket_release_listener
(
client
->
con
->
listensocket_effective
);
}
if
(
stack
)
{
auth_stack_add_client
(
stack
,
client
,
_handle_authentication_mount_normal
,
uri
);
auth_stack_release
(
stack
);
}
else
{
_handle_authentication_mount_normal
(
client
,
uri
,
AUTH_NOMATCH
);
}
}
static
void
_handle_authentication
(
client_t
*
client
,
char
*
uri
)
static
void
_handle_authentication
(
client_t
*
client
,
char
*
uri
)
{
{
fastevent_emit
(
FASTEVENT_TYPE_CLIENT_READY_FOR_AUTH
,
FASTEVENT_FLAG_MODIFICATION_ALLOWED
,
FASTEVENT_DATATYPE_CLIENT
,
client
);
fastevent_emit
(
FASTEVENT_TYPE_CLIENT_READY_FOR_AUTH
,
FASTEVENT_FLAG_MODIFICATION_ALLOWED
,
FASTEVENT_DATATYPE_CLIENT
,
client
);
_handle_authentication_
mount_normal
(
client
,
uri
);
_handle_authentication_
listen_socket
(
client
,
uri
);
}
}
static
void
__prepare_shoutcast_admin_cgi_request
(
client_t
*
client
)
static
void
__prepare_shoutcast_admin_cgi_request
(
client_t
*
client
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment