Modify ↓
Opened 18 years ago
Closed 18 years ago
#1391 closed defect (fixed)
Wrong code @ htfile.py
Reported by: | Tomas Zilinskas | Owned by: | Matt Good |
---|---|---|---|
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 (0)
Change History (3)
comment:1 Changed 18 years ago by
Status: | new → assigned |
---|
comment:2 Changed 18 years ago by
Priority: | highest → normal |
---|---|
Severity: | blocker → normal |
comment:3 Changed 18 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Note: See
TracTickets for help on using
tickets.
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.