Repository navigation
fix(InstallDeps): don't chmod an already executable node binary - #1614
Open
SKroman108 wants to merge 1 commit into
Open
SKroman108 wants to merge 1 commit into
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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