diff options
author | Morris Jobke <hey@morrisjobke.de> | 2015-01-12 17:50:12 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2015-01-12 17:50:12 +0100 |
commit | 58b985b4c08d773aa1576c21236866b7b4e2839e (patch) | |
tree | b386384e0c618f90c999c7c40ed115ee5acae60b | |
parent | 2a0356862322d024c7488c74c8c07697143a6a9e (diff) | |
parent | 793e1e8d6eb3d728715e2fbf9c38e90e1f874d25 (diff) | |
download | nextcloud-server-58b985b4c08d773aa1576c21236866b7b4e2839e.tar.gz nextcloud-server-58b985b4c08d773aa1576c21236866b7b4e2839e.zip |
Merge pull request #13282 from owncloud/occ-user-warning
Check for current user to have the same id then the owner of the config ...
-rw-r--r-- | console.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/console.php b/console.php index 4b0adae539e..f6fba14b7f9 100644 --- a/console.php +++ b/console.php @@ -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()) { |