Fixed testing fping output when the LibreNMS user doesn't have a valid shell (#10567)

This commit is contained in:
Brian Sidebotham
2019-09-02 21:11:24 +01:00
committed by PipoCanaja
parent c73e9cbcfb
commit d0d7d8552e

View File

@@ -251,7 +251,7 @@ class Validator
public function execAsUser($command, &$output = null, &$code = null)
{
if (self::getUsername() === 'root') {
$command = 'su ' . Config::get('user') . ' -c "' . $command . '"';
$command = 'su ' . Config::get('user') . ' -s /bin/sh -c "' . $command . '"';
}
exec($command, $output, $code);
}