Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Xiph.Org
Icecast-Server
Commits
fe0e17db
Commit
fe0e17db
authored
Aug 23, 2007
by
Karl Heyes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug
#1141
svn path=/icecast/trunk/icecast/; revision=13595
parent
176b9f7e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
14 deletions
+24
-14
src/auth.c
src/auth.c
+23
-13
src/auth_htpasswd.h
src/auth_htpasswd.h
+1
-1
No files found.
src/auth.c
View file @
fe0e17db
...
...
@@ -516,7 +516,7 @@ int auth_release_listener (client_t *client)
}
static
void
get_authenticator
(
auth_t
*
auth
,
config_options_t
*
options
)
static
int
get_authenticator
(
auth_t
*
auth
,
config_options_t
*
options
)
{
do
{
...
...
@@ -525,29 +525,31 @@ static void get_authenticator (auth_t *auth, config_options_t *options)
if
(
strcmp
(
auth
->
type
,
"url"
)
==
0
)
{
#ifdef HAVE_AUTH_URL
auth_get_url_auth
(
auth
,
options
);
if
(
auth_get_url_auth
(
auth
,
options
)
<
0
)
return
-
1
;
#else
ERROR0
(
"Auth URL disabled"
);
return
-
1
;
#endif
break
;
}
if
(
strcmp
(
auth
->
type
,
"htpasswd"
)
==
0
)
{
auth_get_htpasswd_auth
(
auth
,
options
);
if
(
auth_get_htpasswd_auth
(
auth
,
options
)
<
0
)
return
-
1
;
break
;
}
ERROR1
(
"Unrecognised authenticator type:
\"
%s
\"
"
,
auth
->
type
);
return
;
return
-
1
;
}
while
(
0
);
auth
->
refcount
=
1
;
while
(
options
)
{
if
(
strcmp
(
options
->
name
,
"allow_duplicate_users"
)
==
0
)
auth
->
allow_duplicate_users
=
atoi
(
options
->
value
);
options
=
options
->
next
;
}
return
0
;
}
...
...
@@ -589,12 +591,20 @@ auth_t *auth_get_authenticator (xmlNodePtr node)
WARN1
(
"unknown auth setting (%s)"
,
current
->
name
);
}
auth
->
type
=
xmlGetProp
(
node
,
"type"
);
get_authenticator
(
auth
,
options
);
auth
->
tailp
=
&
auth
->
head
;
thread_mutex_create
(
&
auth
->
lock
);
auth
->
running
=
1
;
auth
->
thread
=
thread_create
(
"auth thread"
,
auth_run_thread
,
auth
,
THREAD_ATTACHED
);
if
(
get_authenticator
(
auth
,
options
)
<
0
)
{
xmlFree
(
auth
->
type
);
free
(
auth
);
auth
=
NULL
;
}
else
{
auth
->
tailp
=
&
auth
->
head
;
thread_mutex_create
(
&
auth
->
lock
);
auth
->
refcount
=
1
;
auth
->
running
=
1
;
auth
->
thread
=
thread_create
(
"auth thread"
,
auth_run_thread
,
auth
,
THREAD_ATTACHED
);
}
while
(
options
)
{
...
...
src/auth_htpasswd.h
View file @
fe0e17db
...
...
@@ -17,7 +17,7 @@
#include <config.h>
#endif
void
auth_get_htpasswd_auth
(
auth_t
*
auth
,
config_options_t
*
options
);
int
auth_get_htpasswd_auth
(
auth_t
*
auth
,
config_options_t
*
options
);
#endif
...
...
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