This was used to detect the presence of version 3.8.0 which introduced the "su"
config option[^1]. It was releases in 2011, so I'd say it's time that we can
just assume that it's supported.
Additionally, this has a bit of a security impact as it defaults to not using
the "su" option, which means that logrotate will do more than necessary as
root. This happened with our packages as these were built without logrotate
being installed, which caused the version detection to fail. Just assuming the
new version here instead of adding it as a non-obvious build dependency should
be the more robust fix.
[^1]: https://github.com/logrotate/logrotate/blob/r3-8-0/CHANGES#L6-L8
PR 75 (commit afb6346) added support for the 'su' directive of
logrotate. However, when using 'su', we cannot chown to arbitrary file
owners anymore, which means that unless the file has already been
created with the same permissions we'll get an error.
Fix this by not using chown and su together.
- try to detect a recent logrotate version which supports the 'su'
directive (added in 3.8.0, see
5be96cf182 (diff-e4eb329834da3d36278b1b7d943b3bc9R6))
- if logrotate can't be found, assume an old version is used
- allow the parameter to be forced by the user
fixes#9249
Signed-off-by: Gunnar Beutner <gunnar@beutner.name>