blob: a8ef7a5229c00d4ace2a4b612646662539240fd5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
$NetBSD: patch-ar,v 1.1 2005/01/23 17:33:19 taca Exp $
--- lib/webrick/httpauth/htpasswd.rb.orig 2003-07-24 01:51:36.000000000 +0900
+++ lib/webrick/httpauth/htpasswd.rb
@@ -32,7 +32,15 @@ module WEBrick
open(@path){|io|
while line = io.gets
line.chomp!
- user, pass = line.split(":")
+ case line
+ when %r!\A[^:]+:[a-zA-Z0-9./]{13}\z!
+ user, pass = line.split(":")
+ when /:\$/, /:\{SHA\}/
+ raise NotImplementedError,
+ 'MD5, SHA1 .htpasswd file not supported'
+ else
+ raise StandardError, 'bad .htpasswd file'
+ end
@passwd[user] = pass
end
}
|