Skip to content

Guard installer against a failed fileperms() call - #1117

Merged
ADmad merged 1 commit into
cakephp:5.xfrom
jarovarga:ticket-1113-installer-fileperms
Oct 13, 2026
Merged

ADmad merged 1 commit into
cakephp:5.xfrom
jarovarga:ticket-1113-installer-fileperms

Conversation

@jarovarga

Copy link
Copy Markdown
Contributor

fileperms() returns false on failure, and false & 0777 evaluates to 0, so the installer could chmod a directory to 0007 and strip owner and group permissions. Report the failure and skip the path instead.

Also drop the unused STDIN definition, throw InvalidArgumentException from the Y/n validator and report a failed chmod() via writeError(), consistent with the other failure messages.

Fixes #1113

fileperms() returns false on failure, and false & 0777 evaluates to 0,
so the installer could chmod a directory to 0007 and strip owner and
group permissions. Report the failure and skip the path instead.

Also drop the unused STDIN definition, throw InvalidArgumentException
from the Y/n validator and report a failed chmod() via writeError(),
consistent with the other failure messages.

Fixes cakephp#1113
@ADmad ADmad added this to the 5.x milestone Oct 13, 2026
@ADmad
ADmad merged commit 41d5594 into cakephp:5.x Oct 13, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Installer: unchecked fileperms() can remove owner permissions

2 participants