mirror of
https://github.com/nextcloud/server.git
synced 2026-05-19 08:25:56 -04:00
fix(installer): ensure valid tempFile & extractDir
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
This commit is contained in:
parent
6e82b961ca
commit
4b1fa4569d
3 changed files with 9 additions and 5 deletions
|
|
@ -2599,9 +2599,6 @@
|
|||
<code><![CDATA[$matches[0][$last_match]]]></code>
|
||||
<code><![CDATA[$matches[1][$last_match]]]></code>
|
||||
</InvalidArrayOffset>
|
||||
<InvalidScalarArgument>
|
||||
<code><![CDATA[$path]]></code>
|
||||
</InvalidScalarArgument>
|
||||
<UndefinedInterfaceMethod>
|
||||
<code><![CDATA[getQuota]]></code>
|
||||
</UndefinedInterfaceMethod>
|
||||
|
|
|
|||
|
|
@ -241,6 +241,10 @@ class Installer {
|
|||
|
||||
// Download the release
|
||||
$tempFile = $this->tempManager->getTemporaryFile('.tar.gz');
|
||||
if ($tempFile === false) {
|
||||
throw new \RuntimeException('Could not create temporary file for downloading app archive.');
|
||||
}
|
||||
|
||||
$timeout = $this->isCLI ? 0 : 120;
|
||||
$client = $this->clientService->newClient();
|
||||
$client->get($app['releases'][0]['download'], ['sink' => $tempFile, 'timeout' => $timeout]);
|
||||
|
|
@ -252,8 +256,11 @@ class Installer {
|
|||
if ($verified === true) {
|
||||
// Seems to match, let's proceed
|
||||
$extractDir = $this->tempManager->getTemporaryFolder();
|
||||
$archive = new TAR($tempFile);
|
||||
if ($extractDir === false) {
|
||||
throw new \RuntimeException('Could not create temporary directory for unpacking app.');
|
||||
}
|
||||
|
||||
$archive = new TAR($tempFile);
|
||||
if (!$archive->extract($extractDir)) {
|
||||
$errorMessage = 'Could not extract app ' . $appId;
|
||||
|
||||
|
|
|
|||
|
|
@ -206,7 +206,7 @@ class OC_Helper {
|
|||
$exts = [''];
|
||||
$check_fn = 'is_executable';
|
||||
// Default check will be done with $path directories :
|
||||
$dirs = explode(PATH_SEPARATOR, $path);
|
||||
$dirs = explode(PATH_SEPARATOR, (string)$path);
|
||||
// WARNING : We have to check if open_basedir is enabled :
|
||||
$obd = OC::$server->get(IniGetWrapper::class)->getString('open_basedir');
|
||||
if ($obd != 'none') {
|
||||
|
|
|
|||
Loading…
Reference in a new issue