changeset 1473:31c4d92a81e5

mod_auth_ha1: Skip commented lines
author Matthew Wild <mwild1@gmail.com>
date Sun, 27 Jul 2014 14:36:12 +0100
parents d44926f39f00
children d4233dce479f
files mod_auth_ha1/mod_auth_ha1.lua
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_auth_ha1/mod_auth_ha1.lua	Sat Jul 26 21:53:52 2014 +0100
+++ b/mod_auth_ha1/mod_auth_ha1.lua	Sun Jul 27 14:36:12 2014 +0100
@@ -29,7 +29,9 @@
 		line_number = line_number + 1;
 		local username, hash, realm, state = line:match("^([^:]+):(%x+):([^:]+):(.+)$");
 		if not username then
-			module:log("error", "Unable to parse line %d of auth file, skipping", line_number);
+			if line:sub(1,1) ~= "#" then
+				module:log("error", "Unable to parse line %d of auth file, skipping", line_number);
+			end
 		else
 			username, realm = nodeprep(username), nameprep(realm);
 			if not username then