diff --git a/src/auth_htpasswd.c b/src/auth_htpasswd.c index 93dd1947..35b3cf2a 100644 --- a/src/auth_htpasswd.c +++ b/src/auth_htpasswd.c @@ -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 */