[MDEV-29498] better protection against !include directive recursion Created: 2022-09-08  Updated: 2022-09-16

Status: Open
Project: MariaDB Server
Component/s: Configuration
Fix Version/s: None

Type: Task Priority: Minor
Reporter: Hartmut Holzgraefe Assignee: Unassigned
Resolution: Unresolved Votes: 1
Labels: 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.


Generated at Thu Feb 08 10:09:03 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.