Commit 185014d4 authored by Leigh B. Stoller's avatar Leigh B. Stoller

Change to how we get the password for elabman (firstuser). Instruct

user to make sure root has a password, and just take the encrypted
string from the password file. The elabman account is used for very
little anyway.

Also install the rsync port if it is not present; this is a temp hack
until we figure out the package stuff.
parent 8db4edcc
......@@ -79,7 +79,11 @@ to make sure that /usr is at least 8GB and at least a million inodes.
If you want, you can go ahead and create an account for yourself on boss. For
now, just stick the home directory somewhere local, and move it to /users/ once
you've got it mounted from ops (the boss-install script will set this up). In
general, it's probably simpler to just use 'root' for now.
general, it's probably simpler to just use 'root' for now. BE SURE to
give root a password and REMEMBER it! You are going to need it later. To
set the root password:
passwd root
##### Step 1 - Installing packages
......
......@@ -360,6 +360,25 @@ Phase "ports", "Installing ports", sub {
"then re-run this script.");
};
# XXX Temporary.
Phase "portfixup", "Fixing up packages", sub {
Phase "rsync", "Looking for rsync", sub {
if (!ExecQuiet("$PKG_INFO -x rsync")) {
PhaseSkip("rsync already installed");
}
#
# This port is dead-simple, so it's safe to do it from this script
#
my $pwd = `$PWD`;
chomp $pwd;
chdir "$PORTSDIR/net/rsync" or
PhaseFail "Unable to change to $PORTSDIR/net/rsync: $!";
ExecQuietFatal("make -DBATCH install");
chdir $pwd;
};
};
Phase "patches", "Applying patches", sub {
Phase "g++patch", "Patching g++'s STL", sub {
if (!ExecQuiet("$PATCH -C -f -R -p0 -i $STL_PATCH")) {
......@@ -894,10 +913,7 @@ Phase "named", "Setting up initial named configuration", sub {
Phase "firstuser", "Setting up initial user (elabman)", sub {
PhaseSkip("elabman already created")
if (-d "/users/elabman");
PhaseSkip("Not needed unless in batch mode")
if (!$batchmode);
ExecQuietFatal("perl $TOP_OBJDIR/utils/firstuser ".
($batchmode ? " -b" : "") .
ExecQuietFatal("perl $TOP_OBJDIR/utils/firstuser -b ".
(defined($password) ? " -p $password" : ""));
};
......
......@@ -250,6 +250,25 @@ Phase "ports", "Installing ports", sub {
};
};
# XXX Temporary.
Phase "portfixup", "Fixing up packages", sub {
Phase "rsync", "Looking for rsync", sub {
if (!ExecQuiet("$PKG_INFO -x rsync")) {
PhaseSkip("rsync already installed");
}
#
# This port is dead-simple, so it's safe to do it from this script
#
my $pwd = `$PWD`;
chomp $pwd;
chdir "$PORTSDIR/net/rsync" or
PhaseFail "Unable to change to $PORTSDIR/net/rsync: $!";
ExecQuietFatal("make -DBATCH install");
chdir $pwd;
};
};
Phase "patches", "Applying patches", sub {
Phase "m2cryptopatch", "Patching m2crypto", sub {
if (!ExecQuiet("$PATCH -C -f -l -R -p0 -i $M2CRYPTO_PATCH")) {
......
......@@ -30,6 +30,7 @@ my $protoproj = 'emulab-ops';
my $protoproj_desc = 'Operations Meta-Project';
my $batchmode = 0;
my $password;
my $encpass;
my %opts;
#
......@@ -64,14 +65,26 @@ print "meta-project.\n\n";
# Get a password for the user
if (!defined($password)) {
print "Pick a password for $protouser (warning, will be echoed): ";
$password = <>;
chomp($password);
#
# In batch mode, we get it from the root user password entry.
# Otherwise prompt user for it.
#
if ($batchmode) {
(undef,$encpass) = getpwnam("root") or
die("No root user!\n");
}
else {
print "Pick a password for $protouser (warning, will be echoed): ";
$password = <>;
chomp($password);
}
}
if (!defined($encpass)) {
my @salt_chars = ('a'..'z','A'..'Z','0'..'9');
my $salt = $salt_chars[rand(@salt_chars)] .
$salt_chars[rand(@salt_chars)];
$encpass = crypt($password, "\$1\$${salt}");
}
my @salt_chars = ('a'..'z','A'..'Z','0'..'9');
my $salt = $salt_chars[rand(@salt_chars)] .
$salt_chars[rand(@salt_chars)];
my $encpass = crypt($password, "\$1\$${salt}");
# Get uid for the user and a gid for the project
my $uid = 10000;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment