Repository navigation
fix(InstallDeps): don't chmod an already executable node binary - #1614
SKroman108 wants to merge 1 commit into
Conversation
When node_binary points to a system binary such as /usr/bin/node (the Nextcloud AIO image sets it this way), it belongs to root, so chmod() fails and every repair run logs "chmod(): Operation not permitted at .../InstallDeps.php#176". Only try to make the binary executable when it isn't already, and initialise $returnCode in case exec() throws. Also use double quotes so the unsupported-architecture warning shows the architecture. Signed-off-by: SKroman108 <138336203+SKroman108@users.noreply.github.com>
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
Problem
When
node_binarypoints to a system binary,InstallDeps::testBinary()still callschmod()on it. The Nextcloud AIO image setsnode_binaryto/usr/bin/node, which belongs to root, so every repair run (every app or server update) logs:The binary is already executable and works fine. Only the warning is wrong. This is the same report as #1169, which was closed as a permissions problem on the admin's side. The real cause is that the code always runs
chmod().Reproduce (Nextcloud AIO 35.0.2, recognize 13.2.0, aarch64):
Fix
chmod()when the binary isn't executable yet (our own downloaded binary), and suppress the warning if that still fails.exec()reports a binary that really can't run anyway.$returnCode, so that an exception fromexec()doesn't lead to an undefined variable.$uname.Tested on the instance above: the old code logs the warning, the new code runs without it and
node --versionreturnsv24.22.1.🤖 Generated with Claude Code