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

fix: move definitions to inner CMakeLists.txt(s) and correct add_user/add_group #361

Merged
merged 3 commits into from
May 26, 2022

Conversation

leogr
Copy link
Member

@leogr leogr commented May 26, 2022

What type of PR is this?

/kind bug

Any specific area of the project related to this PR?

/area build
/area libsinsp

What this PR does / why we need it:

While testing the latest libs version on Falco, we noticed that user names were not correctly looked up. Digging into the problem, we discovered that a feature gate 👇 was off when building Falco

#ifdef HAVE_PWD_H
if (container_id.empty() && !name)
{
// On Host, try to load info from db
auto *p = getpwuid(uid);
if (p)
{
name = p->pw_name;
home = p->pw_dir;
shell = p->pw_shell;
}
}
#endif

After a further investigation, we realized the root problem was that the add_definition was included in CompilerFlags.cmake, which is not used by client projects (like Falco).

This PR moves relevant compiler definitions in cmake module files (intended to be used by client projects).

UPDATE:
We also found a bug in add_user and add_group. Fixed by 7afbad4

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

This hotfix is needed to release Falco 0.32

Does this PR introduce a user-facing change?:

NONE

Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
@deepskyblue86
Copy link
Contributor

CC @gnosek

leogr added 2 commits May 26, 2022 16:16
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
…group

Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
Copy link
Contributor

@FedeDP FedeDP left a comment

Choose a reason for hiding this comment

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

/approve

@poiana poiana added the lgtm label May 26, 2022
@FedeDP FedeDP mentioned this pull request May 26, 2022
53 tasks
@leogr leogr changed the title build: move definitions to inner CMakeLists.txt(s) fix: move definitions to inner CMakeLists.txt(s) and correct add_user/add_group May 26, 2022
@FedeDP
Copy link
Contributor

FedeDP commented May 26, 2022

/test build-libs-bundled-deps

Copy link
Member

@Andreagit97 Andreagit97 left a comment

Choose a reason for hiding this comment

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

/approve

@poiana
Copy link
Contributor

poiana commented May 26, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Andreagit97, FedeDP, leogr

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [Andreagit97,FedeDP,leogr]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@poiana poiana merged commit 1be9249 into master May 26, 2022
@poiana poiana deleted the build/move-sinsp-definitions branch May 26, 2022 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants