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

savecore: add missing call to cap_openlog when in capabilities mode #1546

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

stephane-rochoy-stormshield
Copy link
Contributor

When run in capabilities mode, savecore seems to lack a call to cap_openlog. Notably it break the use of LOG_PERROR.

With the original one:

$ /sbin/savecore -vC
checking for kernel dump on device /dev/gpt/swapfs
No dump exists

With the patched one:

$ ./savecore -vC
checking for kernel dump on device /dev/gpt/swapfs
savecore 1424 - - /dev/gpt/swapfs: Permission denied
No dump exists

Signed-off-by: Stéphane Rochoy <stephane.rochoy@stormshield.eu>
@stephane-rochoy-stormshield
Copy link
Contributor Author

I'm looking to add a test as it should be trivial.

@stephane-rochoy-stormshield stephane-rochoy-stormshield marked this pull request as draft December 12, 2024 15:27
@emaste
Copy link
Member

emaste commented Dec 12, 2024

Looks good. CC @oshogbo.

Also @bsdimp do we have advice on rebasing/squashing fixup commits in pull requests?

@stephane-rochoy-stormshield
Copy link
Contributor Author

Looks good. CC @oshogbo.

Also @bsdimp do we have advice on rebasing/squashing fixup commits in pull requests?

Yes you have ;) I've put this PR in draft mode for now. I'll squash once ready.
I'm discovering atf(7) and kyua(1) to add at least a basic test.

@emaste
Copy link
Member

emaste commented Dec 12, 2024

Oh yes I didn't notice the Draft tag. The C change itself looks good :)

@bsdimp
Copy link
Member

bsdimp commented Dec 12, 2024

git rebase -i main
squash all the tests into one commit and all the stuff in the actual binary into one. I think that's just the first one and all the rest squashed.

@oshogbo oshogbo self-assigned this Dec 13, 2024
sbin/savecore/tests/log_test.sh Outdated Show resolved Hide resolved
sbin/savecore/tests/log_test.sh Outdated Show resolved Hide resolved
@stephane-rochoy-stormshield
Copy link
Contributor Author

Sorry for the initial noise. I cleaned the commits.

But one question remain about the test I propose to add: what is the proper way to test the instance of savecore from the installed build, i.e., not the one on the system? I find it convenient to make world DESTDIR=… but the tests don't seems to be aware of $DESTDIR.

Signed-off-by: Stéphane Rochoy <stephane.rochoy@stormshield.eu>
@stephane-rochoy-stormshield
Copy link
Contributor Author

But one question remain about the test I propose to add: what is the proper way to test the instance of savecore from the installed build, i.e., not the one on the system? I find it convenient to make world DESTDIR=… but the tests don't seems to be aware of $DESTDIR.

@oshogbo Do you have an opinion on this? Do you want me to just ignore $DESTDIR?

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.

4 participants