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

SCL: impossible to propagate empty string parameter through __VARARGS__ #341

Open
MrAnno opened this issue Oct 15, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@MrAnno
Copy link
Member

MrAnno commented Oct 15, 2024

@version: current

block destination second(...) {
  # something useful with an empty string parameter
};

block destination first(...) {
      second(`__VARARGS__`);
};

log {
   destination{ first(some-param("")) };
};
In /home/anno/dev/axo/syslog/install/etc/syslog-ng.conf:9:28-9:29:
4
5       #Start Block block destination first() at /home/anno/dev/axo/syslog/install/etc/syslog-ng.conf:8
6       ## some_param=
7       @line "/home/anno/dev/axo/syslog/install/etc/syslog-ng.conf" 8 30
8
9----->       second(some_param() );
9----->                            ^
10
11      #End Block block destination first() at /home/anno/dev/axo/syslog/install/etc/syslog-ng.conf:8
12

syslog-ng/syslog-ng#2088 (comment) says the following:

As "" is not mapped into "" anymore, this is a problem needs to be addressed. Luckily, we could break the cycle here, do not need to find another symbol that would be mapped to "", of which again find a symbol that maps to the underlying symbol etc. This can be addressed by modifying such scl. I show an example for this:

Unfortunately, this is not so lucky with varargs. With the current implementation, it is impossible to pass an empty string parameter through varargs.

Remainder from #254

@MrAnno MrAnno added the bug Something isn't working label Oct 15, 2024
@MrAnno
Copy link
Member Author

MrAnno commented Oct 15, 2024

The real resolution of this problem might be the reimplementation of syslog-ng/syslog-ng#2088 in a way that checks mandatory parameters without overriding the meaning of the "" symbol.
SCL declarations could still use the "" syntax to mark the parameter optional, but that should be differentiated from passing "" to this parameter from outside by adding more state to the block generator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant