Repository navigation
test: adapt to the new capsh format - #14768
Merged
keszybz merged 1 commit intoFeb 5, 2020
Merged
Conversation
Since libcap v2.29 the format of cap_to_text() has been changed which makes certain `test-execute` subtest fail. Let's remove the offending part of the output (dropped capabilities) to make it compatible with both the old and the new libcap.
mrc0mmand
added a commit
to mrc0mmand/systemd-centos-ci
that referenced
this pull request
Feb 5, 2020
This reverts commit 0397444. Fixes: systemd#208 Fixed by: systemd/systemd#14768
mrc0mmand
added a commit
to systemd/systemd-centos-ci
that referenced
this pull request
Feb 5, 2020
This reverts commit 0397444. Fixes: #208 Fixed by: systemd/systemd#14768
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.
Since libcap v2.29 the format of
cap_to_text()has been changed whichmakes certain
test-executesubtests fail. Let's remove the offendingpart of the output (dropped capabilities) to make it compatible with
both the old and the new libcap.
Fixes: #14548
I'm not really fan of this change, but it makes it compatible with both
cap_to_text()formats, by simply dropping any (space separated) capability groups marked as dropped (suffixed by-[eip]) from the output.Alternative approaches would be either parsing output of
pscap(fromlibcap-ng-utils), asgetpcapsusescap_to_text()as well, or parsing and AND/OR-ing capabilities directly from/proc/$$/stat. Nothing else comes to my mind right now.I gave it a try in systemd/systemd-centos-ci#220 with
libcap-2.30and it seems to work as expected./cc @keszybz