Commit graph

6 commits

Author SHA1 Message Date
Josh
e48a7c5cf8
fix(occ): set GID before UID to ensure success
The previous implementation attempted to set GID after dropping root UID, which would fail (silently) and made the posix_setgid() call effectively a no-op. This swaps the order to set the target GID first.

Also refactored for clarity:
- Renamed dropPrivileges to switchToConfigFileOwner for clearer intent
- Update docblock to explicitly state best-effort limitations
- Use more descriptive variable names
- Re-organized for readability

Signed-off-by: Josh <josh.t.richards@gmail.com>
2026-05-12 09:30:34 -04:00
provokateurin
e2507b23bd
fix(occ): Suppress errors when checking config.php fileowner
Signed-off-by: provokateurin <kate@provokateurin.de>
2025-03-20 08:03:05 +01:00
Frank Karlitschek
53c083ea2a
fix(occ): Make it possible to run as root
Signed-off-by: Frank Karlitschek <karlitschek@users.noreply.github.com>
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-02-27 20:42:09 +01:00
Andy Scherzinger
5c49a54801
chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-05-26 20:05:04 +02:00
Olivier Paroz
68a9376858 Use a more universal shebang
On FreeBSD, php is usually in /usr/local and I'm sure there are many more exceptions.
2014-11-19 17:34:03 +01:00
Thomas Müller
2871d11b5c adding executable script occ (ownCloud console) 2013-08-05 14:03:11 +02:00