mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-02 05:59:21 +03:00
#208 Block GPG when using open_basedir
This commit is contained in:
parent
fb1c0dd606
commit
25d946b873
1 changed files with 16 additions and 14 deletions
|
|
@ -1381,20 +1381,22 @@ class GPG
|
||||||
|
|
||||||
private static function findBinary($name) : ?string
|
private static function findBinary($name) : ?string
|
||||||
{
|
{
|
||||||
$binary = \trim(`which $name`);
|
if (!\ini_get('open_basedir')) {
|
||||||
if ($binary && \is_executable($binary)) {
|
$binary = \trim(`which $name`);
|
||||||
return $binary;
|
if ($binary && \is_executable($binary)) {
|
||||||
}
|
return $binary;
|
||||||
$locations = [
|
}
|
||||||
'/sw/bin/',
|
$locations = [
|
||||||
'/usr/bin/',
|
'/sw/bin/',
|
||||||
'/usr/local/bin/',
|
'/usr/bin/',
|
||||||
'/opt/local/bin/',
|
'/usr/local/bin/',
|
||||||
'/run/current-system/sw/bin/'
|
'/opt/local/bin/',
|
||||||
];
|
'/run/current-system/sw/bin/'
|
||||||
foreach ($locations as $location) {
|
];
|
||||||
if (\is_executable($location . $name)) {
|
foreach ($locations as $location) {
|
||||||
return $location . $name;
|
if (\is_executable($location . $name)) {
|
||||||
|
return $location . $name;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue