Commit d7c7130c authored by Ryan Jackson's avatar Ryan Jackson

Allow dhcpd_makeconf work correctly for non-root

Make sure that dhcpd_makeconf sets UID to 0 before calling ssh
so that we use root's keypair to log into the subboss.  Drop
root privileges again afterward.
parent 1d8bae47
......@@ -369,9 +369,12 @@ if ($install) {
fatal("Could not kill(TERM) process $dpid (dhcpd): $!");
}
my $old_uid = $UID;
$UID = $EUID;
for my $subboss (keys %subboss_dhcp_servers) {
RestartSubbossDhcp($subboss, $restart);
}
$UID = $old_uid;
}
TBScriptUnlock();
......@@ -394,7 +397,7 @@ sub fatal {
sub RestartSubbossDhcp($$)
{
my ($subboss, $restart) = @_;
my $cmd = "ssh $subboss @prefix@/sbin/subboss_dhcpd_makeconf";
$cmd .= " -r" if ($restart);
......
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