mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-06-05 21:03:40 +00:00
The check phase for the config file has to replace any instances of user and group with the current ones, since logrotate checks whether they actually exist. However, the create/createolddir substitution expressions didn't take all different parameter formats into account. Mainly, if the mode was specified, but not user and group, the result would be something like create 0644nixbld nixbld since it relies on matching a space at the end of the mode specification. To fix this, always append a space before the substituted user and group. Also, simplify the formatting by using extended regex and check for word boundaries after create/createolddir to exclude any incorrect or unsupported suffixes.