[OpenSIPS-Devel] Configuration issue with modparam syntax

Dan Pascu dan at ag-projects.com
Mon Jul 8 13:18:06 EDT 2019


On 8 Jul 2019, at 14:36, Bogdan-Andrei Iancu wrote:

> HI Dan,
> 
> Thanks for the report, but could you please open a bug report on the tracker - is is the easiest way for use to track and work with all the reports in a centralized way.

It turns out the dash in the file name is not the problem. I noticed this after I changed the name of my certificates and the new ones had a dash in the name, so I thought that the cause was some problem with the configuration parser. When I removed the dash from the name the error went away so that strengthened the idea that it must be related to the dash.

What I noticed later made things much weirder, to the point that this bug now looks like something out of the twilight zone. To be honest I'm not even sure how to describe it properly.

In short I have the following facts:

1. I have a configuration file of length N that has the error. The error is something about some items in $acc_extra not being defined when used in route later in the script. With this is doesn't matter if the certificate has a dash or not in its name. All it matter is the size of the configuration file being N.
2. If I add or remove 1 character in such a way that it doesn't create a new line in the file, for example by adding one extra character in a comment line, the error disappears. This character added/removed must come before the acc_extra modparam definition for this to work.
3. Now to make things really weird, consider that the configuration file name is length M and in the error case filename length and file content length is N + M = T. If I keep this T constant, I have the problem. So if I add a character in a comment in the configuration as described above and the problem disappears, because now total length is T+1, the problem reappears if I shorten the configuration file name by 1 character so I have total length and equal with the original T : (N+1) + (M-1) = T.

> 
> Thanks,
> 
> Bogdan-Andrei Iancu
> 
> OpenSIPS Founder and Developer
>  https://www.opensips-solutions.com
> OpenSIPS Summit 2019
>  https://www.opensips.org/events/Summit-2019Amsterdam/
> 
> On 06/26/2019 06:24 PM, Dan Pascu wrote:
>> It seems that at least the ca_list modparam in tls_mgm doesn't accept a dash in filenames. If I have a modparam like:
>> 
>> modparam("tls_mgm", "ca_list", "[default]/etc/opensips/tls/ca-list.pem")
>> 
>> then checking the configuration fails with some obscure error that some source_ip element is not defined in acc_extra (way later in some route in the script).
>> 
>> However if I replace the same with a filename without a dash in it like:
>> 
>> modparam("tls_mgm", "ca_list", "[default]/etc/opensips/tls/calist.pem")
>> 
>> Then the error goes away and opensips is able to start. Not sure if this limitation affects other modparams that specify filenames.
>> 
>> --
>> Dan
>> 
>> 
>> 
>> 
>> 
>> _______________________________________________
>> Devel mailing list
>> Devel at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/devel
> 


--
Dan







More information about the Devel mailing list