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

use GetCapLast() to get CAP_LAST_CAP and avoid to read file "/proc/sys/kernel/cap_last_cap" everytime when importing #27

Closed
wants to merge 1 commit into from

Conversation

ningmingxiao
Copy link

@ningmingxiao ningmingxiao commented Jul 22, 2024

fix #26

@avagin
Copy link
Contributor

avagin commented Jul 22, 2024

pls update the commit message to explain why the change is needed.

@ningmingxiao ningmingxiao changed the title fix always read file /proc/sys/kernel/cap_last_cap in init() use GetCapLast() to get CAP_LAST_CAP and avoid to read file "/proc/sys/kernel/cap_last_cap" everytime when importing Jul 23, 2024
…s/kernel/cap_last_cap" everytime when importing.

Signed-off-by: ningmingxiao <[email protected]>
capVers = hdr.version

if initLastCap() == nil {
CAP_LAST_CAP = capLastCap
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you can remove CAP_LAST_CAP to be sure that old users notice the change and update their code.

BTW: @kolyshkin created the fork https://github.com/kolyshkin/capability and he is going to support it.

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.

import github.com/syndtr/gocapability will auto read /proc/sys/kernel/cap_last_cap
2 participants