Raise OSError on jail(2) failures with the kernel error message - #14
Merged
Conversation
The jail_set, jail_get, jail_attach and jail_remove wrappers check the return value and raise OSError carrying errno and, where a Jiov is involved, the errmsg the kernel filled in. get_jid_by_name and is_jid_dying keep returning -1 and False for missing jails and raise for every other failure. The JAIL_CREATE, JAIL_UPDATE, JAIL_ATTACH and JAIL_DYING constants replace the magic numbers, while raw access through jail.dll stays available.
Duplicate creation reports EEXIST together with the kernel message, and removing or attaching missing jails reports EINVAL. A child process attaches to a fresh jail and checks that its root moved into the jail path.
no-pictures
Bot
force-pushed
the
fix/jail-errors
branch
from
July 8, 2026 09:15
8c59136 to
80b8189
Compare
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.
Failures were only visible as negative return codes and an errmsg buffer nobody was required to check.
generic message.