From 5ec47c750ec7bdf746160dd715726da1dfadfdb7 Mon Sep 17 00:00:00 2001 From: Frank Karlitschek Date: Mon, 15 Aug 2022 18:04:03 +0200 Subject: [PATCH] Update occ make it possible to run as root Signed-off-by: Frank Karlitschek --- occ | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/occ b/occ index 7e47585b01ef7..f918e6cc98283 100755 --- a/occ +++ b/occ @@ -7,5 +7,11 @@ * See the COPYING-README file. */ -//$argv = $_SERVER['argv']; +// make it possible to run as root +if (posix_getuid() == 0){ + $command = implode (' ', $argv); + echo(shell_exec('sudo -u www-data '.$command)); + exit; +} + require_once __DIR__ . '/console.php';