[patch 4/6] strip line in HtPasswdChecker

0 views
Skip to first unread message

Felix Schwarz

unread,
Mar 12, 2008, 4:46:25 PM3/12/08
to authori...@googlegroups.com

when the htpasswd file is read from disk, the line must be strip'ped in
order to get rid of the newline (else password checks will always fail).

--
Felix Schwarz
Dipl.-Informatiker

Gubener Str. 38
10243 Berlin
Germany

www.schwarz.eu - software development and consulting

htpasswd_strip_line

Kevin Horn

unread,
Mar 12, 2008, 7:30:32 PM3/12/08
to authori...@googlegroups.com
Strip the userline from the htpasswd file

diff -r 0894a74ac239 authority/checkers/checkers.py
--- a/authority/checkers/checkers.py    Wed Mar 12 16:50:27 2008 +0100
+++ b/authority/checkers/checkers.py    Wed Mar 12 18:00:44 2008 +0100
@@ -68,7 +68,7 @@ class HtpasswdChecker(AuthenticationChec
        self.authdict = {}
        authfile = open(self.authfilename, 'r')
        for userline in authfile:
-            user, passwdhash = userline.split(':')
+            user, passwdhash = userline.strip().split(':')
            self.authdict[user] = passwdhash

        authfile.close()
@@ -124,4 +124,4 @@ class SMBChecker(AuthenticationChecker):

    def initialize_storage(self):
        raise NotImplementedError
-
\ No newline at end of file
+



applied

Kevin Horn
Reply all
Reply to author
Forward
0 new messages