Ticket #1391 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

Wrong code @ htfile.py

Reported by: Tomas Zilinskas Assigned to: mgood
Priority: normal Component: AccountManagerPlugin
Severity: normal Keywords: code error login
Cc: Trac Release: 0.10

Description

An error seems to exist in TRUNC (and lower) version.

file: htfile.py
line: 63
content: line[len(prefix):-1]
reason: the remaining part of line is read until one symbol remains. This effectively "trims" hash being read and fails to log the user in.
fix: line[len(prefix):len(line)]
effect: the remaining part of the line is read until EOLN.
the error affects at least HTPasswd; the fix allowed me to login using both MD5 and SHA1 hashes.

Attachments

Change History

03/27/07 10:48:57 changed by mgood

  • status changed from new to assigned.

If you run the unit tests (python setup.py test) you'll find that the tests will fail with that change. That piece of code is meant to "trim" the newline at the end of each line since it should not be part of the hash. However, your file appears to be missing a newline on the last line of the file. Both this plugin and the htpasswd tool should generate files ending in a newline, but I'll commit a workaround in case the file is missing this.

03/27/07 10:49:10 changed by mgood

  • priority changed from highest to normal.
  • severity changed from blocker to normal.

03/27/07 10:53:27 changed by mgood

  • status changed from assigned to closed.
  • resolution set to fixed.

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


Add/Change #1391 (Wrong code @ htfile.py)




Change Properties
Action