Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pattern matcher in Logrotate::UserOrGroup is too strict. Doesn't allow names with domain. #88

Closed
ruriky opened this issue Nov 14, 2017 · 1 comment
Labels
bug Something isn't working

Comments

@ruriky
Copy link

ruriky commented Nov 14, 2017

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: [email protected]

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 '[email protected]' 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.

@juniorsysadmin juniorsysadmin added the bug Something isn't working label Dec 2, 2017
@juniorsysadmin
Copy link
Member

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants