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

Update rc.initdiskless, fix error handling of remount_optional #1497

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kevemueller
Copy link

chkerr() ignores the exit code of a preceding mount command in case a file remount_optional exists. The check is performed and a subshell is launched to log the informational message and return. The return is executed in the context of the subshell, not the context of the chkerr() function, hence is a NOP. The remount_optional check is hence ineffective.

Change the code to if/then/fi, so the return is evaluated in the context of the chkerr function, to make the check effective.

chkerr() ignores the exit code of a preceding mount command in case a file ```remount_optional``` exists.
The check is performed and a subshell is launched to log the informational message and return.
The return is executed in the context of the subshell, not the context of the chkerr() function, hence is a NOP.
The remount_optional check is hence ineffective.

Change the code to if/then/fi, so the return is evaluated in the context of the  chkerr function, to make the check effective.
Copy link
Member

@bsdimp bsdimp left a comment

Choose a reason for hiding this comment

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

Subtle but wrong before

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.

2 participants