Commit e91f68fb authored by Leigh B Stoller's avatar Leigh B Stoller

Set a per-vnode root password on shared VMs.

Doing this here allows jailconfig in tmcd to return it.
parent fddcd467
......@@ -2541,6 +2541,13 @@ sub CreateVnodes($$$)
}
$node->SetNodeHistory(TB_NODEHISTORY_OP_CREATE(),
$user, $experiment);
#
# On a shared node, generate a new root password so that
# tmcd can return it in the jail config call. On a dedicated
# node, the physical host password is used.
#
$node->NewRootPasswd()
if (defined($sharing_mode) && $sharing_mode);
}
}
@$rptr = @created;
......@@ -2559,6 +2566,7 @@ sub CreateVnodes($$$)
DBQueryWarn("delete from node_activity where node_id='$vnodeid'");
DBQueryWarn("delete from node_idlestats where node_id='$vnodeid'");
DBQueryWarn("delete from iface_counters where node_id='$vnodeid'");
DBQueryWarn("delete from node_attributes where node_id='$vnodeid'");
}
}
DBQueryFatal("unlock tables");
......@@ -2958,7 +2966,7 @@ sub NewRootPasswd($)
my $hash = TBGenSecretKey();
# But only part of it.
$hash = substr($hash, 0, 10);
$hash = substr($hash, 0, 12);
DBQueryWarn("replace into node_attributes set ".
" node_id='$node_id',".
......
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