Opened 14 years ago

Closed 14 years ago

#1391 closed defect (fixed)

Wrong code @

Reported by: Tomas Zilinskas Owned by: Matt Good
Priority: normal Component: AccountManagerPlugin
Severity: normal Keywords: code error login
Cc: Trac Release: 0.10


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

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 (0)

Change History (3)

comment:1 Changed 14 years ago by Matt Good

Status: newassigned

If you run the unit tests (python 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.

comment:2 Changed 14 years ago by Matt Good

Priority: highestnormal
Severity: blockernormal

comment:3 Changed 14 years ago by Matt Good

Resolution: fixed
Status: assignedclosed

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

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Matt Good.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.