Skip to content
Snippets Groups Projects
Commit 58b985b4 authored by Morris Jobke's avatar Morris Jobke
Browse files

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

Check for current user to have the same id then the owner of the config ...
parents 2a035686 793e1e8d
No related branches found
No related tags found
No related merge requests found
...@@ -22,6 +22,17 @@ try { ...@@ -22,6 +22,17 @@ try {
exit(0); 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, // only load apps if no update is due,
// else only core commands will be available // else only core commands will be available
if (!\OCP\Util::needUpgrade()) { if (!\OCP\Util::needUpgrade()) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment