libs
libs copied to clipboard
Consider scap host root for passwd and group lookup
What type of PR is this?
/kind feature
Any specific area of the project related to this PR?
/area libscap
/area libsinsp
Does this PR require a change in the driver versions?
/version driver-API-version-major
/version driver-API-version-minor
/version driver-API-version-patch
/version driver-SCHEMA-version-major
/version driver-SCHEMA-version-minor
/version driver-SCHEMA-version-patch
What this PR does / why we need it:
Take users and groups considering scap host root.
When no host root is set, fall back using getpwent, getgrent, getpwuid, and getgrgid.
This way, when running on the host we will preserve the lookup with NSS, when running as a container we will show the host users and groups instead of the container ones (from files).
This applies to scap_create_userlist and sinsp_usergroup_manager. Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer: This may look as a change in the current behavior, but actually when running as a container, sinsp will report the host users and groups trying to map them to the container ones, which would be misleading.
Does this PR introduce a user-facing change?:
consider scap host root for passwd and group lookup
I like this! Thank you @deepskyblue86 !
LGTM label has been added.
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: deepskyblue86, FedeDP, Molter73
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [FedeDP,Molter73]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment