-
Notifications
You must be signed in to change notification settings - Fork 346
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
Support domainname #1214
Support domainname #1214
Conversation
@higuruchi Can I ask you to put your signature into your commits? $ git commit --amend --no-edit -s
$ git push -f origin(or upstream?) HEAD |
What is the status of this PR? read for review? If not, please convert to draft PR. |
Signed-off-by: higuruchi <fumiya2324@gmail.com>
53e4a26
to
7b7a45a
Compare
Signed-off-by: higuruchi <fumiya2324@gmail.com>
let res = unsafe { setdomainname(ptr, len) }; | ||
if res == EFAULT { | ||
bail!("Failed to set {} as domainname. domainname pointed outside of user address space.", domainname) | ||
} | ||
if res == EINVAL { | ||
bail!("Failed to set {} as domainname. domainname len was negative or too large.", domainname) | ||
} | ||
if res == EPERM { | ||
bail!("Failed to set {} as domainname. the caller did not have the CAP_SYS_ADMIN capability.", domainname) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about using match
instead of if statements?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modified to match.
And when setdomainname syscall executed errno handling is invalid so fix it.
Hey @higuruchi , can you fix the formatting issue that's failing the check? You will just need to run |
Signed-off-by: higuruchi <fumiya2324@gmail.com>
8b93d23
to
9eb878d
Compare
@higuruchi Thanks for your contribution! |
Add: #1213
Implement
Add a test for it
config.json
Execution result