fix: Use proper file permissions in INSTALL.ts for Linux/WSL#571
Open
m4nt0de4 wants to merge 1 commit intodanielmiessler:mainfrom
Open
fix: Use proper file permissions in INSTALL.ts for Linux/WSL#571m4nt0de4 wants to merge 1 commit intodanielmiessler:mainfrom
m4nt0de4 wants to merge 1 commit intodanielmiessler:mainfrom
Conversation
The fixPermissions() function was running chmod -R 755 on the entire ~/.claude directory, making every file executable including configs, markdown, and JSON files. This is incorrect on Linux/WSL where only directories and scripts should have the execute bit. Replaces the blanket chmod -R 755 with granular permissions: - Directories: 750 (rwxr-x---) - Regular files: 640 (rw-r-----) - Scripts (.ts, .sh, .py): 750 (rwxr-x---) Also uses find -exec ... + instead of \; for better performance. Fixes danielmiessler#484 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.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.
Summary
chmod -R 755(makes ALL files executable) with granular Linux permissions750(rwxr-x---), files:640(rw-r-----), scripts:750(rwxr-x---)find -exec ... +instead of\;for better performanceProblem
fixPermissions()in INSTALL.ts runschmod -R 755on the entire~/.claudedirectory, making every file executable — including JSON configs, markdown files, and YAML. On Linux/WSL, only directories and scripts should have the execute bit. This is both a security issue (unnecessary execute permissions) and breaks expectations for standard Linux file permissions.The function also runs
chmod -R 755three times (steps 1, 3, and the script step), which is redundant.Fix
Replace the three-step chmod/chown/chmod approach with:
chown -R— set ownership firstfind -type d -exec chmod 750— directories onlyfind -type f -exec chmod 640— regular files (no execute)find -type f -name "*.ts|*.sh|*.py" -exec chmod 750— scripts onlyTest plan
.tsand.shfiles have execute permission (750).json,.md,.yamlfiles do NOT have execute permission (640)Fixes #484
🤖 Generated with Claude Code