Skip to content
This repository was archived by the owner on Nov 4, 2024. It is now read-only.

Commit 325c748

Browse files
author
the-djmaze
committed
Check open basedir for #1555
1 parent ff80235 commit 325c748

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

snappymail/v/0.0.0/app/libraries/RainLoop/Utils.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,7 @@ public static function inOpenBasedir(string $name) : string
134134
{
135135
static $open_basedir;
136136
if (null === $open_basedir) {
137-
$open_basedir = \ini_get('open_basedir');
138-
if ($open_basedir) {
139-
\SnappyMail\Log::warning('OpenBasedir', "open_basedir restriction in effect. Allowed path(s): {$open_basedir}");
140-
}
141-
$open_basedir = \array_filter(\explode(PATH_SEPARATOR, $open_basedir));
137+
$open_basedir = \array_filter(\explode(PATH_SEPARATOR, \ini_get('open_basedir')));
142138
}
143139
if ($open_basedir) {
144140
foreach ($open_basedir as $dir) {

snappymail/v/0.0.0/app/libraries/snappymail/gpg/base.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ protected function proc_close() : int
484484
protected static function findBinary($name) : ?string
485485
{
486486
$binary = \trim((string) `which $name`);
487-
if ($binary && \is_executable($binary)) {
487+
if ($binary && \RainLoop\Utils::inOpenBasedir($binary) && \is_executable($binary)) {
488488
return $binary;
489489
}
490490
$locations = \array_filter([

0 commit comments

Comments
 (0)