ksud/installer: fix handling of paths with spaces#3510
Open
Fanju6 wants to merge 3 commits into
Open
Conversation
Fanju6
commented
Jun 7, 2026
- Quote arguments in set_perm to prevent shell word splitting.
- Use find -print0 and read -r -d '' in set_perm_recursive to safely handle files and directories with spaces.
- Quote arguments in set_perm to prevent shell word splitting. - Use find -print0 and read -r -d '' in set_perm_recursive to safely handle files and directories with spaces.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the ksud installer helper functions to better handle filesystem paths containing spaces during permission-fixing steps, which is important for reliable module installation across varied environments.
Changes:
- Adjusts
set_perm_recursiveto avoid shell word-splitting when iterating directories/files. - Updates the
findinvocation for files/links to use correct operator grouping.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+296
to
+300
| find "$1" -type d -print0 2>/dev/null | while IFS= read -r -d '' dir; do | ||
| set_perm "$dir" "$2" "$3" "$4" "$6" | ||
| done | ||
| find $1 -type f -o -type l 2>/dev/null | while read file; do | ||
| set_perm $file $2 $3 $5 $6 | ||
| find "$1" \( -type f -o -type l \) -print0 2>/dev/null | while IFS= read -r -d '' file; do | ||
| set_perm "$file" "$2" "$3" "$5" "$6" |
Comment on lines
+297
to
+300
| set_perm "$dir" "$2" "$3" "$4" "$6" | ||
| done | ||
| find $1 -type f -o -type l 2>/dev/null | while read file; do | ||
| set_perm $file $2 $3 $5 $6 | ||
| find "$1" \( -type f -o -type l \) -print0 2>/dev/null | while IFS= read -r -d '' file; do | ||
| set_perm "$file" "$2" "$3" "$5" "$6" |
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.