Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix splitting spaces in paths from statetab files #471

Merged
merged 2 commits into from
Jan 29, 2024

Conversation

deajan
Copy link
Contributor

@deajan deajan commented Jan 23, 2024

Noticed that paths with spaces in /etc/statetab and /etc/statetab.d/* weren't interpreted.
Since a for loop was used, bash just splitted paths at default IFS chars.

Since we could have paths with spaces like /opt/my service in statetab, we need to read the statetab files line per line, with IFS being '\n', which can be accomplished by using a while loop.
This is already done for rwtab.

@mergify mergify bot added the Fedora label Jan 23, 2024
usr/libexec/readonly-root Fixed Show fixed Hide fixed
usr/libexec/readonly-root Fixed Show fixed Hide fixed
@deajan
Copy link
Contributor Author

deajan commented Jan 28, 2024

PR initially fixed defect SC2013.
Got complaints from shellcheck about new SC2162 defect.

Initially wanted to code comply with current implementation of readonly-root script where rwtab's while loop didn't mangle backspaces (no SC2162 fix).

So updated this PR to fix SC2162 including the one from rwtab's while loop.

Has been tested on a couple of RHEL 9 setups with both rwtab and statetab entries.

[EDIT] I understand that readonly-root is deprecated. But it still has full RHEL 9 support until 2031, so I do think it's a good idea to have that little bug fix included :) [/EDIT]

@jamacku jamacku self-assigned this Jan 29, 2024
Copy link
Member

@jamacku jamacku left a comment

Choose a reason for hiding this comment

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

@deajan Thank you for the bug fix; it's very much appreciated.

I'm going to include it in the upcoming RHEL9 release.

@mergify mergify bot merged commit c8292a5 into fedora-sysv:main Jan 29, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants