-
Notifications
You must be signed in to change notification settings - Fork 471
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
Driver specific template escaping #4666
Driver specific template escaping #4666
Commits on Oct 8, 2023
-
light: move stringify outside of the SyslogNGConfig class
Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for a859450 - Browse repository at this point
Copy the full SHA a859450View commit details
Commits on Oct 14, 2023
-
Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 65a2859 - Browse repository at this point
Copy the full SHA 65a2859View commit details -
light: add support for creating template statements
Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 1744b38 - Browse repository at this point
Copy the full SHA 1744b38View commit details -
light: add testcases to exercise templates
Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 37432b5 - Browse repository at this point
Copy the full SHA 37432b5View commit details -
cfg-grammar.y: extract template_name_or_content rule
Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 59be6b2 - Browse repository at this point
Copy the full SHA 59be6b2View commit details -
cfg-grammar.y: move template_item rule
Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 9fd3b31 - Browse repository at this point
Copy the full SHA 9fd3b31View commit details -
cfg-grammar: eliminate last_template variable
In order to recurse into our grammar we can't use global variables to track objects we are parsing into. This solution uses the $0 value for rule actions to pass arguments to that specific rule, this time the LogTemplate instance we need to parse into. That way the LogTemplate instance would be separate even if we are recursing into the same parts of the grammar. A similar solution could potentially be established to all similar cases, using global variables in a recursive grammar is not right. Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 7f05114 - Browse repository at this point
Copy the full SHA 7f05114View commit details -
cfg-grammar: use lexer context to recognize named templates
To be able to use separate grammar rules for template references and inline templates. Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for a11ce5a - Browse repository at this point
Copy the full SHA a11ce5aView commit details -
template: move template related global logic/variables to separate mo…
…dule Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 5a15f0f - Browse repository at this point
Copy the full SHA 5a15f0fView commit details -
template: move LogTemplateOptions to common_template_typedefs
Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 6a8f7c6 - Browse repository at this point
Copy the full SHA 6a8f7c6View commit details -
template: extract log_template_append_elem_value()
Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 06eeb2e - Browse repository at this point
Copy the full SHA 06eeb2eView commit details -
template: extract log_template_append_elem_macro()
Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 35ab205 - Browse repository at this point
Copy the full SHA 35ab205View commit details -
template: extract log_template_append_elem_func()
Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 7b19fc9 - Browse repository at this point
Copy the full SHA 7b19fc9View commit details -
template: differentiate top-level and embedded template expressions
A top_level LogTemplate is one which is instantiated directly from the configuration or by a driver. For embedded LogTemplate instances (e.g. within function invocations), this is FALSE. The idea is that some operations (e.g. escaping) are only performed at the top level. Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 1ac5d9c - Browse repository at this point
Copy the full SHA 1ac5d9cView commit details -
template: add "escape" setting to LogTemplateOptions as well
With this patch it becomes possible to enable escaping from both the LogTemplate side (e.g. when template-escape(yes) is present in a template statement) and the LogTemplateOptions side (e.g. with the destination driver specific template-escape()) option. Previously only LogWriter supplied this setting and it only worked in case of an inline template. With this change, this works with all drivers that support the `template_option` grammar rule. Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for bb90c4d - Browse repository at this point
Copy the full SHA bb90c4dView commit details -
template: perform escaping on the result of functions
Earlier, template functions were performing escaping as a part of their own expansion of macros/values. This means that a template-escape(yes) template, with embedded template functions, the template functions received its arguments in an escaped form. For example this template: template t_escaped { template("$(echo $(length ${value}))"); template-escape(yes) }; where $value contains characters that need to be escaped (e.g. quotes or control characters), $(length) received the escaped format. This patch changes this behaviour slightly by: 1) embedded template expressions always get strings in an unescaped form 2) the end result of functions are escaped at the top-level. Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for d1e9e64 - Browse repository at this point
Copy the full SHA d1e9e64View commit details -
template: apply escaping to all kinds of LogTemplateElems
This patch moves escaping to one layer higher, thereby ensuring a consistent escaping implmentation and simplifying the lower layers. Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for e4b22c2 - Browse repository at this point
Copy the full SHA e4b22c2View commit details -
template: remove escaping support from macro expansion
Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 38ffb93 - Browse repository at this point
Copy the full SHA 38ffb93View commit details -
template: use simple g_string_append_len() instead of result_append()
Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ab14167 - Browse repository at this point
Copy the full SHA ab14167View commit details -
template: add support for escape callback through LogTemplateEvalOptions
With this change the call-site of log_template_format_*() family of functions can supply a custom escaping mechanism. Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 7be4356 - Browse repository at this point
Copy the full SHA 7be4356View commit details
Commits on Oct 19, 2023
-
Signed-off-by: Attila Szakacs <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for b8723c8 - Browse repository at this point
Copy the full SHA b8723c8View commit details -
light: remove duplicate import
Signed-off-by: Attila Szakacs <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 2b79680 - Browse repository at this point
Copy the full SHA 2b79680View commit details