Commit 0c6ba0c7 authored by Michael Smith's avatar Michael Smith
Browse files

Fix bug reported by - don't crash in htpasswd auth

if the auth file doesn't exist.

svn path=/icecast/trunk/icecast/; revision=9867
parent 3116f62a
......@@ -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);
htpasswd->users = avl_tree_new(compare_users, NULL);
thread_rwlock_unlock (&htpasswd->file_rwlock);
if (file_stat.st_mtime == htpasswd->mtime)
/* common case, no update to file */
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment