Project

General

Profile

Bug #574

Config upgrade for non-default admin username broken

Added by Chris Buechler about 9 years ago. Updated about 9 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
User manager
Target version:
Start date:
05/06/2010
Due date:
% Done:

50%

Estimated time:
Affected Version:
2.0
Affected Architecture:

Description

Configs with an admin username other than 'admin' don't upgrade properly.

Associated revisions

Revision 5adb44fb (diff)
Added by Seth Mos about 9 years ago

Fix creation of admin user account with uid of 0. This fixes ticket #574

History

#1 Updated by Seth Mos about 9 years ago

  • Category changed from Config upgrade to User manager
  • Status changed from New to Feedback
  • % Done changed from 0 to 50

Fixed the local user account sync, this had the admin user account hardcoded. It also attempted to perform a usermod operation before the user existed.

Changed the order of the local_user_set() function and corrected the hard coded username.
Appended -o to the user add operation to allow for multiple uid 0 users, which is required for the admin account.

#2 Updated by Seth Mos about 9 years ago

  • Status changed from Feedback to Resolved

#3 Updated by Jim Pingle about 9 years ago

  • Status changed from Resolved to New

This is now giving admin a shell of /bin/sh when it should be /etc/rc.initial

#4 Updated by Erik Fonnesbeck about 9 years ago

The line already said /bin/sh, but if that part wasn't working before, then it wouldn't have changed it. It is probably the line that looks like this:

$cmd = "/usr/sbin/pw usermod -q -n {$user_name} -s /bin/sh -H 0";

If it is only used for users that should get the console menu, then it should probably look like this instead:

$cmd = "/usr/sbin/pw usermod -q -n {$user_name} -s /etc/rc.initial -H 0";

#5 Updated by Seth Mos about 9 years ago

  • Status changed from New to Feedback

Changed the pw usermod for the administrator account from /bin/sh to /etc/rc.initial. This should fix the wrong shell.

https://rcs.pfsense.org/projects/pfsense/repos/mainline/commits/883b25522646849a376438c6413b0b5fd008e60f

#6 Updated by Seth Mos about 9 years ago

  • Status changed from Feedback to Resolved

Verified that this change correctly sets the shell for the administrator user.

Also available in: Atom PDF