Skip to content

Conversation

@kolyshkin
Copy link
Collaborator

See commits for details.

@lifubang PTAL

1. Use testing.TB so it can also be used from a benchmark.

2. Add a call to t.Helper.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
 - do not manipulate bounding set, it is not needed;
 - use a single list; add one more capability to it;
 - set Permitted/Inheritable/Effective at once;
 - use Unset to unset a capability;
 - use loop for the last check.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
pid.Set(AMBIENT, capAmbient...)
if err = pid.Apply(CAPS | BOUNDING | AMBIENT); err != nil {

list := []Cap{CAP_KILL, CAP_CHOWN, CAP_SYS_CHROOT}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From docker to kubernetes, they always fill each type cap sets with the same cap bits, I think maybe it's wrong. So I want to test cap sets with different caps, this is my thought.
But anyway, it's not worth to be different in this test.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I understand that (what I don't understand is why they do it that way -- for example, why drop bounding capabilities at all; but that is way out of scope for this PR).

@kolyshkin kolyshkin merged commit e9445a4 into moby:main Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants