Skip to content

Commit b3f4a73

Browse files
authored
Merge pull request #741 from nextcloud/fix/740/broken-url-flag
2 parents b18065b + aa565f7 commit b3f4a73

5 files changed

Lines changed: 13 additions & 6 deletions

File tree

index.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,6 @@ private function getUpdateServerResponse(): array {
580580
$this->silentLog('[info] updateURL: ' . $updateURL);
581581

582582
$maxRetries = 2;
583-
$lastException = null;
584583

585584
for ($attempt = 1; $attempt <= $maxRetries; $attempt++) {
586585
try {
@@ -872,14 +871,19 @@ private function getDownloadedFilePath(): string {
872871
*
873872
* @throws \Exception
874873
*/
875-
public function verifyIntegrity(): void {
874+
public function verifyIntegrity(string $urlOverride = ''): void {
876875
$this->silentLog('[info] verifyIntegrity()');
877876

878877
if ($this->getCurrentReleaseChannel() === 'daily') {
879878
$this->silentLog('[info] current channel is "daily" which is not signed. Skipping verification.');
880879
return;
881880
}
882881

882+
if ($urlOverride !== '') {
883+
$this->silentLog('[info] custom download url provided, cannot verify signature');
884+
return;
885+
}
886+
883887
$response = $this->getUpdateServerResponse();
884888
if (empty($response['signature'])) {
885889
throw new \Exception('No signature specified for defined update');

lib/UpdateCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ protected function executeStep(int $step, OutputInterface $output): array {
463463
$this->updater->silentLog('[info] Skipping integrity check as requested');
464464
break;
465465
}
466-
$this->updater->verifyIntegrity();
466+
$this->updater->verifyIntegrity($this->urlOverride);
467467
break;
468468
case 6:
469469
$this->updater->extractDownload();

lib/Updater.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,6 @@ private function getUpdateServerResponse(): array {
564564
$this->silentLog('[info] updateURL: ' . $updateURL);
565565

566566
$maxRetries = 2;
567-
$lastException = null;
568567

569568
for ($attempt = 1; $attempt <= $maxRetries; $attempt++) {
570569
try {
@@ -856,14 +855,19 @@ private function getDownloadedFilePath(): string {
856855
*
857856
* @throws \Exception
858857
*/
859-
public function verifyIntegrity(): void {
858+
public function verifyIntegrity(string $urlOverride = ''): void {
860859
$this->silentLog('[info] verifyIntegrity()');
861860

862861
if ($this->getCurrentReleaseChannel() === 'daily') {
863862
$this->silentLog('[info] current channel is "daily" which is not signed. Skipping verification.');
864863
return;
865864
}
866865

866+
if ($urlOverride !== '') {
867+
$this->silentLog('[info] custom download url provided, cannot verify signature');
868+
return;
869+
}
870+
867871
$response = $this->getUpdateServerResponse();
868872
if (empty($response['signature'])) {
869873
throw new \Exception('No signature specified for defined update');

tests/features/bootstrap/FeatureContext.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,4 +614,3 @@ public function theUpdateServerIsUnreachable() {
614614
// Intentionally do NOT start any server on port 8871
615615
}
616616
}
617-

updater.phar

-171 KB
Binary file not shown.

0 commit comments

Comments
 (0)