You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My configuration used the following include statement:
Include /var/www/*/custom/config/proftpd.conf
The included configuration files contain <VirtualHost> clauses, but the virutal hosts are not available. Log file shows nothing at initialization and Unknown host '$FOO.domain.example' requested on $IP#21, refusing HOST command upon connection attempts to $FOO.
What I Expected/Wanted
Virtual hosts should be available, i.e. config files should be included.
How to fix it
Please be kind, I am not a developer. It took me a couple of hours to nail this down, but finally I can say that the problem is in src/parser.c parse_wildcard_config_path(). Lines 1032ff concatenate parent paths up to the first wildcard:
But they do so only if parent_path is initialized, which is not the case at the first iteration. Thus the first component is silently dropped and config files are searched (but not found) in www/*/custom/config/proftpd.conf instead. Adding a leading dummy path component serves as a workaround for the problem - seems like nobody ever has tried such a configuration.
I'd suggest dropping lines 1021-1023 and 1036-1038 (initializing parent_path) and instead do the initialization at line 1014 (before checking for wildcards); however I am not sure if this might result in unwanted behavior for other inputs as I am not at all familiar with the bigger picture of this logic.
ProFTPD Version and Configuration
Originally 1.3.7a, but the bug is reproducible in the master branch as well.
During debugging I reduced my configuration to the single include line stated above. This should be sufficient to reproduce the problem.
The text was updated successfully, but these errors were encountered:
Castaglia
changed the title
"Include" broken when using wildcards for directory components
Include directive broken when using wildcards for directory components
Jun 18, 2022
What I Did
My configuration used the following include statement:
The included configuration files contain
<VirtualHost>
clauses, but the virutal hosts are not available. Log file shows nothing at initialization andUnknown host '$FOO.domain.example' requested on $IP#21, refusing HOST command
upon connection attempts to $FOO.What I Expected/Wanted
Virtual hosts should be available, i.e. config files should be included.
How to fix it
Please be kind, I am not a developer. It took me a couple of hours to nail this down, but finally I can say that the problem is in src/parser.c
parse_wildcard_config_path()
. Lines 1032ff concatenate parent paths up to the first wildcard:But they do so only if parent_path is initialized, which is not the case at the first iteration. Thus the first component is silently dropped and config files are searched (but not found) in
www/*/custom/config/proftpd.conf
instead. Adding a leading dummy path component serves as a workaround for the problem - seems like nobody ever has tried such a configuration.I'd suggest dropping lines 1021-1023 and 1036-1038 (initializing parent_path) and instead do the initialization at line 1014 (before checking for wildcards); however I am not sure if this might result in unwanted behavior for other inputs as I am not at all familiar with the bigger picture of this logic.
ProFTPD Version and Configuration
Originally 1.3.7a, but the bug is reproducible in the master branch as well.
During debugging I reduced my configuration to the single
include
line stated above. This should be sufficient to reproduce the problem.The text was updated successfully, but these errors were encountered: