Changeset 2128

Show
Ignore:
Timestamp:
03/27/07 10:53:23 (1 year ago)
Author:
mgood
Message:

AccountManagerPlugin:

make sure not to trim hash if it does not end in a newline (fixes #1391)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • accountmanagerplugin/0.10/acct_mgr/htfile.py

    r2120 r2128  
    7070                if line.startswith(prefix): 
    7171                    return self._check_userline(password, prefix, 
    72                                                 line[len(prefix):-1]
     72                                                line[len(prefix):].rstrip('\n')
    7373        finally: 
    7474            fd.close() 
  • accountmanagerplugin/0.10/acct_mgr/tests/htfile.py

    r2119 r2128  
    7272                               'user:{SHA}W6ph5Mm5Pz8GgiULbPgzG37mj9g=\n') 
    7373 
     74    def test_no_trailing_newline(self): 
     75        self._do_password_test('test_no_trailing_newline', 
     76                               'user:$apr1$xW/09...$fb150dT95SoL1HwXtHS/I0') 
     77 
    7478    def _do_password_test(self, filename, content): 
    7579        store = HtPasswdStore(self.env) 
  • accountmanagerplugin/trunk/acct_mgr/htfile.py

    r2120 r2128  
    6161                if line.startswith(prefix): 
    6262                    return self._check_userline(password, prefix, 
    63                                                 line[len(prefix):-1]
     63                                                line[len(prefix):].rstrip('\n')
    6464        finally: 
    6565            fd.close() 
  • accountmanagerplugin/trunk/acct_mgr/tests/htfile.py

    r2118 r2128  
    7272                               'user:{SHA}W6ph5Mm5Pz8GgiULbPgzG37mj9g=\n') 
    7373 
     74    def test_no_trailing_newline(self): 
     75        self._do_password_test('test_no_trailing_newline', 
     76                               'user:$apr1$xW/09...$fb150dT95SoL1HwXtHS/I0') 
     77 
    7478    def _do_password_test(self, filename, content): 
    7579        store = HtPasswdStore(self.env)