@@ -59,18 +59,20 @@ function exceptionHandler($exception) {
5959
6060 set_exception_handler ('exceptionHandler ' );
6161
62+ $ config = \OC ::$ server ->getConfig ();
63+
6264 if (!function_exists ('posix_getuid ' )) {
6365 echo "The posix extensions are required - see https://www.php.net/manual/en/book.posix.php " . PHP_EOL ;
6466 exit (1 );
6567 }
6668 $ user = posix_getuid ();
67- $ configUser = fileowner (OC ::$ configDir . 'config.php ' );
69+ $ dataDirectoryUser = fileowner ($ config -> getSystemValueString ( ' datadirectory ' , \ OC ::$ SERVERROOT . '/data ' ) );
6870 if ($ user !== $ configUser ) {
69- echo "Console has to be executed with the user that owns the file config/config.php " . PHP_EOL ;
71+ echo "Console has to be executed with the user that owns the data directory " . PHP_EOL ;
7072 echo "Current user id: " . $ user . PHP_EOL ;
71- echo "Owner id of config.php : " . $ configUser . PHP_EOL ;
72- echo "Try adding 'sudo -u # " . $ configUser . "' to the beginning of the command (without the single quotes) " . PHP_EOL ;
73- echo "If running with 'docker exec' try adding the option '-u " . $ configUser . "' to the docker command (without the single quotes) " . PHP_EOL ;
73+ echo "Owner id of the data directory : " . $ dataDirectoryUser . PHP_EOL ;
74+ echo "Try adding 'sudo -u # " . $ dataDirectoryUser . "' to the beginning of the command (without the single quotes) " . PHP_EOL ;
75+ echo "If running with 'docker exec' try adding the option '-u " . $ dataDirectoryUser . "' to the docker command (without the single quotes) " . PHP_EOL ;
7476 exit (1 );
7577 }
7678
@@ -90,7 +92,7 @@ function exceptionHandler($exception) {
9092 }
9193
9294 $ application = new Application (
93- \ OC :: $ server -> getConfig () ,
95+ $ config ,
9496 \OC ::$ server ->get (\OCP \EventDispatcher \IEventDispatcher::class),
9597 \OC ::$ server ->getRequest (),
9698 \OC ::$ server ->get (\Psr \Log \LoggerInterface::class),
0 commit comments