Project

General

Profile

Bug #5859

Bug #5844: FreeNAS default blank password

New installer need to prompt for root password during installation

Added by Jordan Hubbard over 6 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Nice to have
Assignee:
Sean Fagan
Category:
OS
Target version:
Severity:
New
Reason for Closing:
Reason for Blocked:
Needs QA:
Yes
Needs Doc:
Yes
Needs Merging:
Yes
Needs Automation:
No
Support Suite Ticket:
n/a
Hardware Configuration:
ChangeLog Required:
No

Description

In order to fix the "blank password" problem in the parent task, we also need to set the root password during installation.

History

#1 Updated by Sean Fagan over 6 years ago

As stated, I don't know how to do this. So let me know.

We'll only want to do this for non-upgrade installs.

#2 Updated by Sean Fagan about 6 years ago

  • Status changed from Unscreened to Fix In Progress

Okay, to do this I'll change netcli to look at argv1, similar to some other things.

After that, then change the installer to run "netcli reset_root_pw" in the new boot environment.

Something like:

--- a/src/freenas/etc/netcli
+++ b/src/freenas/etc/netcli
@ -1075,6 +1075,11 @ def main_menu():
menu_max = menu_max + 1
menu_map[menu_max] = item

+ if len(sys.argv) == 1:
+ if sys.argv1 in locals() and not sys.argv1.startswith("main"):
+ locals()[sys.argv1]()
+ sys.exit(0)
+
while True:
print
print _("Console setup")

#3 Updated by Josh Paetzel about 6 years ago

There are some python paradigms for this sort of thing.

Our python programmers tend to get twitchy when we see python that looks like it was written by a (c|shell|perl) programmer. ;). If you extend netcli to look at argv and then do os.system("netcli blah") from another python script you could cause brain bleeds.

I might suggest looking at how notifier.py handles being used from the command line and imported and used from other python modules. (I can't believe I just recommended looking at notifier.py...)

#4 Updated by Sean Fagan about 6 years ago

The install script is sh, not python.

Annoyingly, python won't import a python file unless it ends in ".py". So netcli, which has what I want and therefore I would prefer not to duplicate it, is a mutant half-breed.

So I will simply add something like

chroot /tmp/data /etc/netcli reset_root_pw

I asked about it in irc. Nobody seemed too upset by it.

#5 Updated by Sean Fagan about 6 years ago

  • Status changed from Fix In Progress to Resolved

#6 Updated by Dru Lavigne about 6 years ago

  • Status changed from Resolved to Closed

Verified in M4.

Also available in: Atom PDF