Ticket #3200 (closed defect: fixed)

Opened 5 months ago

Last modified 5 months ago

Adding and registering users corrupts password file with no carriage return.

Reported by: anonymous Assigned to: mgood
Priority: normal Component: AccountManagerPlugin
Severity: minor Keywords:
Cc: Trac Release: 0.10

Description

(Problem is exhibites on windows Server 2003 with Python 2.4. Did not try *nix platforms yet.)

If original password file does not contain empty line at the bottom (to be technical, if the last line in the file does not contain '\n' at the end of it), new user + password entries are added to the same last line. This, effectively, makes last, and all new users inaccessible.

I suggest to switch to another way of parsing / changing / adding users to password files. Maybe do something like:

file = open(filename,'rw') # this way we lock the file
lines = file.read.splitlines() 
# this, as opposed to readlines() parses \r\n properly on windows

# work with the list object

file.write('\n'.join(lines))
file.close()

That approach is may be a problem on large user lists, but the intricacies of carriage returns and other glitches go away.

In the mean time, a quick solution to the problem

Attachments

Change History

06/17/08 12:09:54 changed by anonymous

In the mean time, a quick solution to the problem is to add a few carriage returns to the end of the password file.

06/17/08 14:21:55 changed by mgood

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

(In [3857]) make sure last line of ht files has a newline (fixes #3200)


Add/Change #3200 (Adding and registering users corrupts password file with no carriage return.)




Change Properties
Action