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

detect/integers: add support for negated strings when enum is used - v2 #12453

Closed

Conversation

AkakiAlice
Copy link
Contributor

@AkakiAlice AkakiAlice commented Jan 22, 2025

Ticket: #7513

Contribution style:

Our Contribution agreements:

Changes (if applicable):

Link to ticket: https://redmine.openinfosecfoundation.org/issues/7513

Describe changes:

  • fix red CLI for rfb-rules-8

SV_BRANCH=OISF/suricata-verify#2250
Previous PR = #12444

function detect_parse_uint_enum can parse strings like !bind_request

Ticket: OISF#7513
@AkakiAlice
Copy link
Contributor Author

I edited my comment to add SV_BRANCH, so I think we have to rerun the checks to use the right sv branch

Copy link

codecov bot commented Jan 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.63%. Comparing base (95e8427) to head (a813902).
Report is 30 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #12453   +/-   ##
=======================================
  Coverage   80.63%   80.63%           
=======================================
  Files         920      920           
  Lines      258704   258710    +6     
=======================================
+ Hits       208595   208620   +25     
+ Misses      50109    50090   -19     
Flag Coverage Δ
fuzzcorpus 56.81% <80.00%> (+<0.01%) ⬆️
livemode 19.39% <0.00%> (-0.01%) ⬇️
pcap 44.31% <0.00%> (-0.02%) ⬇️
suricata-verify 63.25% <100.00%> (-0.01%) ⬇️
unittests 58.52% <80.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Copy link
Contributor

@catenacyber catenacyber left a comment

Choose a reason for hiding this comment

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

Thanks for the work :-)

All good, except we want some doc addition :-)

CI : 🟢
Code : good
Commits segmentation : ok thanks
Commit messages : good
Git ID set : looks fine for me
CLA : you already contributed
Doc update : ⚠️ need an addition in doc/userguide/rules/integer-keywords.rst enumerations section
Redmine ticket : ok
Rustfmt : good :-)
Tests : nice, thanks
Dependencies added: none

if let Ok((_, ctx)) = detect_parse_uint::<T1>(s) {
return Some(ctx);
}

let (s, neg) = opt::<&str, _, Error<_>, _>(char('!'))(s).ok()?;
Copy link
Contributor

Choose a reason for hiding this comment

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

-    let (s, neg) = opt::<&str, _, Error<_>, _>(char('!'))(s).ok()?;
+    // we need to precise the Error type, we get error[E0283]: type annotations needed
+    let (s, neg) = opt(char::<_, Error<_>>('!'))(s).ok()?;

We can put a comment and have a slightly simplex syntax

@AkakiAlice
Copy link
Contributor Author

Replaced by: #12484

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants