mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
fix: validate suid is set for fping (#5474)
This commit is contained in:
committed by
Neil Lathwood
parent
408babb88d
commit
dc4747e853
@@ -213,10 +213,14 @@ if ($space_check < 1) {
|
||||
}
|
||||
|
||||
// Check programs
|
||||
$bins = array('fping','rrdtool','snmpwalk','snmpget','snmpbulkwalk');
|
||||
$bins = array('fping','fping6','rrdtool','snmpwalk','snmpget','snmpbulkwalk');
|
||||
$suid_bins = array('fping', 'fping6');
|
||||
foreach ($bins as $bin) {
|
||||
if (!is_file($config[$bin])) {
|
||||
$cmd = rtrim(shell_exec("which {$config[$bin]} 2>/dev/null"));
|
||||
if (!$cmd) {
|
||||
print_fail("$bin location is incorrect or bin not installed");
|
||||
} elseif (in_array($bin, $suid_bins) && !(fileperms($cmd) & 2048)) {
|
||||
print_fail("$bin should be suid, please chmod u+s $cmd");
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user