mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2024-12-04 14:46:30 -05:00
Fix bug reported by Jason@weatherserver.net - don't crash in htpasswd auth
if the auth file doesn't exist. svn path=/icecast/trunk/icecast/; revision=9867
This commit is contained in:
parent
3116f62a9d
commit
0c6ba0c798
@ -129,8 +129,16 @@ static void htpasswd_recheckfile (htpasswd_auth_state *htpasswd)
|
||||
if (stat (htpasswd->filename, &file_stat) < 0)
|
||||
{
|
||||
WARN1 ("failed to check status of %s", htpasswd->filename);
|
||||
|
||||
/* Create a dummy users tree for things to use later */
|
||||
thread_rwlock_wlock (&htpasswd->file_rwlock);
|
||||
if(!htpasswd->users)
|
||||
htpasswd->users = avl_tree_new(compare_users, NULL);
|
||||
thread_rwlock_unlock (&htpasswd->file_rwlock);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (file_stat.st_mtime == htpasswd->mtime)
|
||||
{
|
||||
/* common case, no update to file */
|
||||
|
Loading…
Reference in New Issue
Block a user