[Pkg-owncloud-commits] [owncloud] 43/74: Show warning when invalid user was passed

David Prévot taffit at moszumanska.debian.org
Tue Dec 2 22:04:36 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit f64c6c9c9cb48ce2291c5c613e80794e6130a85d
Author: Vincent Petry <pvince81 at owncloud.com>
Date:   Fri Nov 14 12:45:36 2014 +0100

    Show warning when invalid user was passed
    
    Sometimes there are bugs that cause setupFS() to be called for
    non-existing users. Instead of failing hard and breaking the instance,
    this fix simply logs a warning.
    
    Backport c941c3fa5139ba4f122d4f40d9c9db5e50f8bcb7 from master
---
 apps/files_external/lib/config.php | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php
index 9e58b1d..717426c 100644
--- a/apps/files_external/lib/config.php
+++ b/apps/files_external/lib/config.php
@@ -121,6 +121,14 @@ class OC_Mount_Config {
 
 		if ($data['user']) {
 			$user = \OC::$server->getUserManager()->get($data['user']);
+			if (!$user) {
+				\OC_Log::write(
+					'files_external',
+					'Cannot init external mount points for non-existant user "' . $data['user'] . '".',
+					\OC_Log::WARN
+				);
+				return;
+			}
 			$userView = new \OC\Files\View('/' . $user->getUID() . '/files');
 			$changePropagator = new \OC\Files\Cache\ChangePropagator($userView);
 			$etagPropagator = new \OCA\Files_External\EtagPropagator($user, $changePropagator, \OC::$server->getConfig());

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list