Skip to content

cip-check-setuid: add regex support to configuration syntax

Right now, it is not possible to check the attributes of files where the full filename is not known in advance (e.g. because they are dynamically created by another programme) using cip-check-setuid. We have exactly this situation with a programme at our chair right now.

This commit adds support for regular expressions to cip-check-setuid's configuration file syntax. If the file path in a configuration line has the prefix REGEX: it will be compiled to a regular expression, instead of matching on the path.

Matching is implemented in such a way that exact filename matches take precedence over regular expression matches. Regular expressions are only considered if no exact filename match is found. If that is the case, regular expressions are checked in the order they were encountered in the configuration and the matching stops at the first pattern that matches the filepath.

Edited by Harald Böhm

Merge request reports

Loading