bug
svn: r4535
This commit is contained in:
parent
e98caf31c1
commit
37a25a74df
|
@ -23,20 +23,23 @@
|
|||
(define last-read-time (box #f))
|
||||
(define password-cache (box #f))
|
||||
(define (update-password-cache!)
|
||||
(define cur-mtime (file-or-directory-modify-seconds password-file))
|
||||
(when (and (file-exists? password-file) (memq 'read (file-or-directory-permissions password-file)))
|
||||
(let ([cur-mtime (file-or-directory-modify-seconds password-file)])
|
||||
(when (or (not (unbox last-read-time))
|
||||
(cur-mtime . > . (unbox last-read-time))
|
||||
(not (unbox password-cache)))
|
||||
(set-box! last-read-time cur-mtime)
|
||||
; more here - a malformed password file will kill the connection
|
||||
(set-box! password-cache (read-passwords password-file))))
|
||||
(set-box! password-cache (read-passwords password-file))))))
|
||||
(define (read-password-cache)
|
||||
(update-password-cache!)
|
||||
(unbox password-cache))
|
||||
(lambda (conn req)
|
||||
(define-values (uri method path) (decompose-request req))
|
||||
(define denied? (read-password-cache))
|
||||
(cond
|
||||
[(access-denied? method path (request-headers/raw req) (read-password-cache))
|
||||
[(and denied?
|
||||
(access-denied? method path (request-headers/raw req) denied?))
|
||||
=> (lambda (realm)
|
||||
(adjust-connection-timeout! conn password-connection-timeout)
|
||||
(request-authentication conn method uri
|
||||
|
@ -80,7 +83,6 @@
|
|||
(raise (make-exn:password-file (string->immutable-string
|
||||
(format "could not load password file ~a" password-path))
|
||||
(current-continuation-marks))))])
|
||||
(if (and (file-exists? password-path) (memq 'read (file-or-directory-permissions password-path)))
|
||||
(let ([passwords
|
||||
(let ([raw (load password-path)])
|
||||
(unless (password-list? raw)
|
||||
|
@ -99,8 +101,7 @@
|
|||
(bytes->string/utf-8 password)))
|
||||
#f
|
||||
(pass-entry-domain x)))))
|
||||
passwords)))
|
||||
(lambda (req user pass) #f))))
|
||||
passwords)))))
|
||||
|
||||
(define fake-user (gensym))
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user