mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fix 500 error in validations when capabilities are not supported or set (#13991)
* Fix 500 error in validations when capabilities are not supported or set * Update Programs.php * Update Programs.php Co-authored-by: Tony Murray <murraytony@gmail.com>
This commit is contained in:
@@ -107,7 +107,7 @@ class Programs extends BaseValidation
|
||||
$getcap_out = shell_exec("$getcap $cmd");
|
||||
preg_match("#^$cmd = (.*)$#", $getcap_out, $matches);
|
||||
|
||||
if (is_null($matches) || ! Str::contains($matches[1], 'cap_net_raw+ep')) {
|
||||
if (empty($matches) || ! Str::contains($matches[1], 'cap_net_raw+ep')) {
|
||||
$validator->fail(
|
||||
"$cmd should have CAP_NET_RAW!",
|
||||
"setcap cap_net_raw+ep $cmd"
|
||||
|
Reference in New Issue
Block a user