mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-01 05:29:20 +03:00
Check open basedir for #1555
This commit is contained in:
parent
ff80235ee8
commit
325c748acc
2 changed files with 2 additions and 6 deletions
|
|
@ -134,11 +134,7 @@ class Utils
|
|||
{
|
||||
static $open_basedir;
|
||||
if (null === $open_basedir) {
|
||||
$open_basedir = \ini_get('open_basedir');
|
||||
if ($open_basedir) {
|
||||
\SnappyMail\Log::warning('OpenBasedir', "open_basedir restriction in effect. Allowed path(s): {$open_basedir}");
|
||||
}
|
||||
$open_basedir = \array_filter(\explode(PATH_SEPARATOR, $open_basedir));
|
||||
$open_basedir = \array_filter(\explode(PATH_SEPARATOR, \ini_get('open_basedir')));
|
||||
}
|
||||
if ($open_basedir) {
|
||||
foreach ($open_basedir as $dir) {
|
||||
|
|
|
|||
|
|
@ -484,7 +484,7 @@ abstract class Base
|
|||
protected static function findBinary($name) : ?string
|
||||
{
|
||||
$binary = \trim((string) `which $name`);
|
||||
if ($binary && \is_executable($binary)) {
|
||||
if ($binary && \RainLoop\Utils::inOpenBasedir($binary) && \is_executable($binary)) {
|
||||
return $binary;
|
||||
}
|
||||
$locations = \array_filter([
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue