#180 closed defect (fixed)
changing password creates double entries in password file
Reported by: | Owned by: | Matt Good | |
---|---|---|---|
Priority: | normal | Component: | AccountManagerPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.9 |
Description
using this plugin to change a password creates double entries in the password file for the user. I looked through your code and I'm not sure why that is. I am currently using trac .9.3 with apache 2.0.55 and python 2.4.2 on windows XP
Attachments (0)
Change History (12)
comment:1 Changed 19 years ago by
comment:2 Changed 19 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Hi! the problem in in htfile.py, a wrong indent followed by a wrong conditional statement. this is the patch:
def _update_file(self, prefix, userline):
filename = self._get_filename() written = False if os.path.exists(filename):
for line in fileinput.input(filename, inplace=True):
if line.startswith(prefix):
if not written and userline:
print userline written = True
else:
print line,
if userline and not written:
f = open(filename, 'a') try:
print >>f, userline
finally:
f.close()
return written
comment:3 Changed 19 years ago by
Arg! sorry...
right code for changes is :
....
....
....
if not written and userline:
print userline
written = True
....
....
if userline and not written:
f = open(filename, 'a')
....
....
comment:4 Changed 19 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Don't close the ticket until your patch has been committed or it will be lost.
comment:5 Changed 19 years ago by
Has this been confirmed and tested/committed? It's been like 9 days since the post (sorry if I'm expecting too much :-) )
comment:6 Changed 19 years ago by
I don't know, the only thing that I can say is that I use this patch in my trac site ( and it works well :) ). please contact me if I should do a particular way to make my patches accepted.
comment:7 Changed 18 years ago by
Trac Release: | → 0.8 |
---|
Actually, I don't believe the indent is wrong.
I think the proper fix is actually just a one line change:
- if userline: + if not written and userline:
comment:8 Changed 18 years ago by
I didn't intend to set 'release' to '0.8'.
It seems someone has reconfigured this Trac so that it gets set on any ticket which does not have a 'release' value set, when someone next makes a comment.
comment:9 Changed 18 years ago by
Trac Release: | 0.8 → 0.9 |
---|
comment:10 Changed 18 years ago by
OK. Trac barfed when I tried to upload the patch. Anyway, it's exactly what maxb had.
comment:11 Changed 18 years ago by
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
comment:12 Changed 18 years ago by
Thanks for debugging this. Sorry for the long delay in getting these changes committed. I've added some docs on that method now too, since I couldn't quite remember exactly what its behavior was supposed to be ;)
Just wanted to say that I'm running trac 0.9.3, apache, and python 2.4.2 on a linux box (FC4), and it's doing the same thing to me. So, it's not isolated. It always updates both lines w/the new hash, and it doesn't seem to ever create more than two copies of a line. So, it's not that big of a deal, but it is odd.