Merge pull request #13282 from owncloud/occ-user-warning

Check for current user to have the same id then the owner of the config ...
This commit is contained in:
Morris Jobke 2015-01-12 17:50:12 +01:00
commit 58b985b4c0
1 changed files with 11 additions and 0 deletions

View File

@ -22,6 +22,17 @@ try {
exit(0);
}
if (!OC_Util::runningOnWindows()) {
$user = posix_getpwuid(posix_getuid());
$configUser = posix_getpwuid(fileowner(OC::$SERVERROOT . '/config/config.php'));
if ($user['name'] !== $configUser['name']) {
echo "Console has to be executed with the same user as the web server is operated" . PHP_EOL;
echo "Current user: " . $user['name'] . PHP_EOL;
echo "Web server user: " . $configUser['name'] . PHP_EOL;
exit(0);
}
}
// only load apps if no update is due,
// else only core commands will be available
if (!\OCP\Util::needUpgrade()) {