diff options
Diffstat (limited to 'modules-available/rebootcontrol/hooks')
3 files changed, 6 insertions, 4 deletions
diff --git a/modules-available/rebootcontrol/hooks/client-update.inc.php b/modules-available/rebootcontrol/hooks/client-update.inc.php index 006a5e11..e934988d 100644 --- a/modules-available/rebootcontrol/hooks/client-update.inc.php +++ b/modules-available/rebootcontrol/hooks/client-update.inc.php @@ -7,7 +7,7 @@ if ($type === '~poweron') { && $subnet[0] === $ip && $subnet[1] >= 8 && $subnet[1] < 32) { $start = ip2long($ip); if ($start !== false) { - $maskHost = (int)(pow(2, 32 - $subnet[1]) - 1); + $maskHost = (int)(2 ** (32 - $subnet[1]) - 1); $maskNet = ~$maskHost & 0xffffffff; $end = $start | $maskHost; $start &= $maskNet; diff --git a/modules-available/rebootcontrol/hooks/config-tgz.inc.php b/modules-available/rebootcontrol/hooks/config-tgz.inc.php index 90e32e8a..c9ce1255 100644 --- a/modules-available/rebootcontrol/hooks/config-tgz.inc.php +++ b/modules-available/rebootcontrol/hooks/config-tgz.inc.php @@ -8,8 +8,10 @@ if (!is_file($tmpfile) || !is_readable($tmpfile) || filemtime($tmpfile) + 86400 } try { $a = new PharData($tmpfile); - $a["/etc/ssh/mgmt/authorized_keys"] = $pubkey; - $a["/etc/ssh/mgmt/authorized_keys"]->chmod(0600); + $a->addFromString("/etc/ssh/mgmt/authorized_keys", $pubkey); + $fi = $a->offsetGet("/etc/ssh/mgmt/authorized_keys"); + /** @var PharFileInfo $fi */ + $fi->chmod(0600); $file = $tmpfile; } catch (Exception $e) { EventLog::failure('Could not include ssh key for reboot-control in config.tgz', (string)$e); diff --git a/modules-available/rebootcontrol/hooks/cron.inc.php b/modules-available/rebootcontrol/hooks/cron.inc.php index cdecc31b..289426c7 100644 --- a/modules-available/rebootcontrol/hooks/cron.inc.php +++ b/modules-available/rebootcontrol/hooks/cron.inc.php @@ -24,7 +24,7 @@ class Stuff public static $subnets; } -function destSawPw($destTask, $destMachine, $passwd) +function destSawPw(array $destTask, array $destMachine, string $passwd): bool { return strpos($destTask['data']['result'][$destMachine['machineuuid']]['stdout'], "passwd=$passwd") !== false; } |