mirror of
https://github.com/systemd/systemd.git
synced 2026-11-06 05:17:24 +00:00
The metric list is built with conf_files_list_strv(), but each metric's value is then looked up again by walking report_files_dirs[] by hand, and the two disagreed whenever an earlier directory had an entry that is not a regular file: - conf_files_list_strv() skipped such an entry and listed the one from a later directory, so the metric was advertised by Describe(); - file_metric_generate() only moved on to the next directory on -ENOENT, so it hit the non-regular entry, logged a warning and produced nothing. The practical case is masking a vendor-supplied entry with a symlink to /dev/null: the metric kept being described, was never listed, and every scrape logged "Failed to open ..., skipping: File descriptor in bad state". Honour masks in the enumeration via CONF_FILES_FILTER_MASKED_BY_SYMLINK, as other conf dirs do, and make the lookup skip non-regular entries the same way the enumeration does. Document the masking in the man page and cover both cases in TEST-74-AUX-UTILS.report.