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

lua: remove default search path for output modules - v1 #12563

Closed
wants to merge 4 commits into from

Conversation

jasonish
Copy link
Member

Removes the search path for Lua modules. It now must be set in the
configuration file. This provides a consistent starting point for all installs
of Suricata.

As we no longer use the system provided Lua, we can't provide a sane default
for every installation environment.

Ticket: https://redmine.openinfosecfoundation.org/issues/7169

Copy link

codecov bot commented Feb 11, 2025

Codecov Report

Attention: Patch coverage is 86.20690% with 4 lines in your changes missing coverage. Please review.

Project coverage is 80.70%. Comparing base (0165830) to head (1f8fab7).
Report is 19 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #12563   +/-   ##
=======================================
  Coverage   80.70%   80.70%           
=======================================
  Files         928      928           
  Lines      259013   259034   +21     
=======================================
+ Hits       209033   209055   +22     
+ Misses      49980    49979    -1     
Flag Coverage Δ
fuzzcorpus 56.96% <0.00%> (+<0.01%) ⬆️
livemode 19.40% <0.00%> (+<0.01%) ⬆️
pcap 44.17% <0.00%> (-0.03%) ⬇️
suricata-verify 63.39% <86.20%> (-0.01%) ⬇️
unittests 58.37% <0.00%> (-0.01%) ⬇️

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

@suricata-qa
Copy link

Information: QA ran without warnings.

Pipeline 24690

src/output-lua.c Outdated
Comment on lines 655 to 660
BUG_ON(parent_ctx == NULL);
LogLuaMasterCtx *mc = parent_ctx->data;
BUG_ON(mc == NULL);

const char *dir = "";
if (parent_ctx && parent_ctx->data) {
LogLuaMasterCtx *mc = parent_ctx->data;
dir = mc->path;
}
dir = mc->script_dir;
Copy link
Member Author

Choose a reason for hiding this comment

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

This is all to show that I don't think parent_ctx and parent_ctx->data can be NULL anymore, or its not clear how we could here with them being NULL.

It had a rather generic name of "path", which in Lua usually means a
search path, which we'll be adding.
By default, use an empty search path. This gives us a predictable
default. If a user needs access to external modules, the search path
must be set in the configuration file.

Ticket: OISF#7169
- Sandboxed Lua for rules
- Search path changes for Lua output scripts
@suricata-qa
Copy link

Information: QA ran without warnings.

Pipeline 24701

@jasonish
Copy link
Member Author

Replaced by #12576

@jasonish jasonish closed this Feb 13, 2025
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