Skip to content

Include statement lacks whitespace before path #38

@SignalWhisperer

Description

@SignalWhisperer

In the conf_parse.peg file, there's the following:

%% An include is a line that begins with 'include' and something.
include <- ws* "include" ws* included_file_or_dir comment? %{
    [_, _Include, _, Included, _] = Node,
    {include, Included}
%};

I think the ws* between "include" and included_file_or_dir might be incorrect as that also allows no whitespace. This would allow includehelloworld to be valid and that likely should be an error instead. It should be ws+ instead of ws*.

I have tested using RabbitMQ (which uses version 3.1.0 of cuttlefish) and confirmed it tries to load the file helloworld when I place includehelloworld in the configuration file.

I expect it to error out and only accept include helloworld, with at least one whitespace mandatory.


I understand how widespread this "misuse" could be (although I did not perform any meaningful search to that matter), and I understand if there is a decision to not fix it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions