Details
-
Task
-
Status: Open (View Workflow)
-
Minor
-
Resolution: Unresolved
-
None
-
None
Description
Right now the !include and !includedir directives only protect themselves against recursion by counting recursion depth.
We had a user run into this as they had added
!include /etc/mysql/mariadb.cnf
|
to their my.cnf, not being aware that the later is just a symlink to the former and so both being the same file actually, and so causing an include look that prevent a later !includedir from being processed.
I would suggest that in addition to tracking recursion depth the realpath of each file and directory included so far should be remembered, to filter out double includes before even running into a recursive include situation.
As the number of included configuration file should not be extremely high to begin with, and as the information can safely be discarded again after having processed the full configuration, this should not be any big issue memory wise, and would make the config parsing process more robust.