fix(userspace/libsinsp): correct fallback for arg-less proc.* fields#2704
fix(userspace/libsinsp): correct fallback for arg-less proc.* fields#2704
Conversation
Parsing of ARG_ALLOWED fields in output formatting (e.g., `proc_args=%proc.args`) was broken because the `val ==` check always returned false. This fix drops the unnecessary checks so that `argid = -1` is set /, `argname` is cleared where appropriate, and correctly sets field-name length using `std::size(...)-1`. Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2704 +/- ##
=======================================
Coverage 76.91% 76.92%
=======================================
Files 294 294
Lines 30862 30853 -9
Branches 4689 4680 -9
=======================================
- Hits 23739 23735 -4
+ Misses 7123 7118 -5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
terror96
left a comment
There was a problem hiding this comment.
/lgtm
again, out of curiosity: why is that in some cases in the body of catch we set m_argid and clear `m_argname`` but not always?
That said, I don't like this legacy implementation too much. These code paths should be reviewed and eventually refactored with a cleaner approach, but this is outside the scope of this PR 👼 |
|
/milestone 0.22.2 |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ekoops, leogr, terror96 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind bug
/kind cleanup
Any specific area of the project related to this PR?
/area libsinsp
Does this PR require a change in the driver versions?
What this PR does / why we need it:
Parsing of ARG_ALLOWED fields in output formatting (e.g.,
proc_args=%proc.args) was broken because theval ==check always returned false. This fix drops the unnecessary checks so thatargid = -1is set /,argnameis cleared where appropriate, and correctly sets field-name length usingstd::size(...)-1.Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
We likely need to issue Falco 0.42.1 because of this.
Tenatively for
/milestone 0.23.0
(but we likely need 0.22.2)
Does this PR introduce a user-facing change?: