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.

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

@bsdimp
Copy link
Member

bsdimp commented Dec 12, 2024

I staged this, but got the error

ERROR: Real email adress is needed
#2:
Author: Keve Müller <[email protected]>

Can you offer a better email?

Also, while you're at it, can you wrap the body of the commit message at 72 columns (+/-) please if you do this by updating the commit?

@bsdimp
Copy link
Member

bsdimp commented Dec 12, 2024

We need the email for this and #1452

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.
@kevemueller
Copy link
Author

pushed with private email address.

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