Modify

Opened 6 years ago

Closed 6 years ago

#3200 closed defect (fixed)

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

Reported by: anonymous Owned by: 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 (0)

Change History (2)

comment:1 Changed 6 years ago 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.

comment:2 Changed 6 years ago by mgood

  • Resolution set to fixed
  • Status changed from new to closed

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

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.