Skip to content

ksud/installer: fix handling of paths with spaces#3510

Open
Fanju6 wants to merge 3 commits into
tiann:mainfrom
Fanju6:main
Open

ksud/installer: fix handling of paths with spaces#3510
Fanju6 wants to merge 3 commits into
tiann:mainfrom
Fanju6:main

Conversation

@Fanju6

@Fanju6 Fanju6 commented Jun 7, 2026

Copy link
Copy Markdown
  • 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.

Fanju6 and others added 3 commits June 7, 2026 17:40
- 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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_recursive to avoid shell word-splitting when iterating directories/files.
  • Updates the find invocation 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"
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.

3 participants