From f5d3b973398245def2327911992e576850933bed Mon Sep 17 00:00:00 2001 From: Terranom674 Date: Thu, 20 Aug 2026 16:14:41 +0200 Subject: [PATCH] Use absolute runtime path for manual WebDAV sync --- include/nc_connector_system.inc.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/include/nc_connector_system.inc.php b/include/nc_connector_system.inc.php index 6214d7f..4809d3e 100644 --- a/include/nc_connector_system.inc.php +++ b/include/nc_connector_system.inc.php @@ -48,7 +48,13 @@ function bratonien_tools_nc_connector_run_now() throw new RuntimeException('WebDAV-Abgleich konnte nicht gestartet werden: proc_open ist in PHP nicht verfügbar.'); } - $script = BRATONIEN_TOOLS_PATH.'runtime/run-all.sh'; + $runtime_dir = realpath(dirname(__DIR__).'/runtime'); + if ($runtime_dir === false || !is_dir($runtime_dir)) + { + throw new RuntimeException('WebDAV-Abgleich konnte nicht gestartet werden: Runtime-Verzeichnis wurde nicht gefunden.'); + } + + $script = $runtime_dir.'/run-all.sh'; if (!is_file($script) || !is_readable($script)) { throw new RuntimeException('WebDAV-Abgleich konnte nicht gestartet werden: runtime/run-all.sh ist nicht lesbar.'); @@ -60,7 +66,7 @@ function bratonien_tools_nc_connector_run_now() 2=>array('pipe','w'), ); $environment = array_merge($_ENV, array('LC_ALL'=>'C','LANG'=>'C')); - $process = @proc_open(array('/usr/bin/env','bash',$script), $spec, $pipes, BRATONIEN_TOOLS_PATH.'runtime', $environment); + $process = @proc_open(array('/usr/bin/env','bash',$script), $spec, $pipes, $runtime_dir, $environment); if (!is_resource($process)) { throw new RuntimeException('WebDAV-Abgleich konnte nicht gestartet werden: Connector-Prozess konnte nicht geöffnet werden.');