Conversation
|
Finding the right user is doable from config.php ownership guessing. The tricky part is STDIN/STDOUT/STDERR handling. Neither with shell_exec nor proc_open I was able to connect the parent process pipes with the child process. shell_exec makes the parent block when occ asks for input (e.g. when you make a typo or when it needs confirmation). I've pushed some fixes that make this work on a non-Debian system too. |
|
@ChristophWurst I pushed a commit which should resolve this. Also there is no need for a fallback, because if there is no |
ChristophWurst
left a comment
There was a problem hiding this comment.
Tested and works. Very nice solution, @susnux 👏
nickvergessen
left a comment
There was a problem hiding this comment.
Files belong to my own user. Works fine here with:
- php occ
- sudo php occ
- sudo -u nickvergessen php occ
So sounds good to me
|
I will then squash it and we can merge + backport it, looks straight forward enough :-O |
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>
29180a5 to
53c083e
Compare
|
/backport to stable31 |
|
/backport to stable30 |
|
Wohoooo. Feeling like a community contributor now 😀 |
|
Ok. Nothing of my code is left. Bit still cool 😎 |
make it possible to run as root
To do
Handle exit codesHandle STDIN/STDOUT/STDERR streams