Pattern matcher in Logrotate::UserOrGroup is too strict. Doesn't allow names with domain.
Closed this issue · 1 comments
Affected Puppet, Ruby, OS and module versions/distributions
- Puppet: 4.8.2
- Ruby: 2.0.0p648
- Distribution: RedHat 7.3
- Module version: 3.1.0 / master
How to reproduce (e.g Puppet code you use)
Create a rule where the value of $su_owner and/or $su_group is in the following format: username@userdomain.com
What are you seeing
Error when Puppet is evaluating the correctness of the username / groupname.
What behaviour did you expect instead
Username/Group name with domain name in the end should be valid user/group name.
Output log
Error: Evaluation Error: Error while evaluating a Resource Statement, Logrotate::Rule[httpd-lb-error-files]: parameter 'su_group' expects a match for Logrotate::UserOrGroup = Pattern[/^[a-z_][a-z0-9_-]{0,30}$/], got 'username@domain.com' at /home/user/puppet/modules/logrotate/manifests/rules.pp:6 on node svx-development04.linux.company.com
Any additional information you'd like to impart
It seems that the current Pattern matcher doesn't like the '@' and '.' characters.
@ruriky You are using bad practices for the name of a user or group, but they're probably still valid.
The man page for useradd has recommendations, but restrictions are distribution/library dependent, so we should probably just make the Puppet type a string.