5 Commits e69e2c5473 ... 9ef93976e8

Author SHA1 Message Date
  Roeland Jago Douma 9ef93976e8 Merge pull request #16080 from nextcloud/backport/15956/stable16 4 years ago
  Roeland Jago Douma 870a330abb Merge pull request #16038 from nextcloud/backport/15889/stable16 4 years ago
  Georg Ehrke 27a9b7f3fa Fix appid argument for integrity:check-app 4 years ago
  Robin Appelman b22fca475a fix tests 4 years ago
  Robin Appelman 42930f6fab handle storage exceptions when trying to set mtime 4 years ago
3 changed files with 11 additions and 3 deletions
  1. 2 2
      core/Command/Integrity/CheckApp.php
  2. 6 1
      lib/private/Files/View.php
  3. 3 0
      tests/lib/Files/ViewTest.php

+ 2 - 2
core/Command/Integrity/CheckApp.php

@@ -45,7 +45,7 @@ class CheckApp extends Base {
 		parent::__construct();
 		$this->checker = $checker;
 	}
-	
+
 	/**
 	 * {@inheritdoc }
 	 */
@@ -54,7 +54,7 @@ class CheckApp extends Base {
 		$this
 			->setName('integrity:check-app')
 			->setDescription('Check integrity of an app using a signature.')
-			->addArgument('appid', null, InputArgument::REQUIRED, 'Application to check')
+			->addArgument('appid', InputArgument::REQUIRED, 'Application to check')
 			->addOption('path', null, InputOption::VALUE_OPTIONAL, 'Path to application. If none is given it will be guessed.');
 	}
 

+ 6 - 1
lib/private/Files/View.php

@@ -566,7 +566,12 @@ class View {
 			$hooks[] = 'create';
 			$hooks[] = 'write';
 		}
-		$result = $this->basicOperation('touch', $path, $hooks, $mtime);
+		try {
+			$result = $this->basicOperation('touch', $path, $hooks, $mtime);
+		} catch (\Exception $e) {
+			$this->logger->logException($e, ['level' => ILogger::INFO, 'message' => 'Error while setting modified time']);
+			$result = false;
+		}
 		if (!$result) {
 			// If create file fails because of permissions on external storage like SMB folders,
 			// check file exists and return false if not.

+ 3 - 0
tests/lib/Files/ViewTest.php

@@ -1962,6 +1962,9 @@ class ViewTest extends \Test\TestCase {
 		$operationArgs,
 		$path
 	) {
+		if ($operation === 'touch') {
+			$this->markTestSkipped("touch handles storage exceptions internally");
+		}
 		$view = new View('/' . $this->user . '/files/');
 
 		/** @var Temporary|\PHPUnit_Framework_MockObject_MockObject $storage */