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

Fixes #11449: Allow variable as directive parameters in regexp validated inputs #1757

Conversation

VinceMacBuche
Copy link
Member

@VinceMacBuche
Copy link
Member Author

Close for now, this needs to be tested

@@ -53,14 +53,14 @@ case class RegexConstraint(pattern: String, errorMsg: String) extends HashcodeCa

val compiled = Pattern.compile(pattern)

val variablePattern = Pattern.compile(".*\\$\\{.*\\}.*")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i fear it may be a bit too eager

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, actually, i can't see why it should be an issue

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes we don't want to analyze it deeply do it does not need to be perfect matches for cases i tested ... (one var, two vars, var inside a var ... )

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the regexp so it's less eager (added ? after * so it matches as less possible)

@VinceMacBuche VinceMacBuche reopened this Oct 16, 2017
@VinceMacBuche
Copy link
Member Author

Commit modified

@VinceMacBuche VinceMacBuche force-pushed the bug_11449/hosts_technique_does_not_allow_to_use_sys_ipv4_or_any_other_variable branch from 5d5e881 to 0da78d3 Compare October 16, 2017 13:52
@VinceMacBuche
Copy link
Member Author

Commit modified

@VinceMacBuche VinceMacBuche force-pushed the bug_11449/hosts_technique_does_not_allow_to_use_sys_ipv4_or_any_other_variable branch from 0da78d3 to d26155d Compare October 16, 2017 14:33
@VinceMacBuche VinceMacBuche changed the title Fixes #11449: Hosts technique does not allow to use $sys.ipv4 or any other variable Fixes #11449: Allow variable as directive parameters in regexp validated inputs Oct 16, 2017
@Normation-Quality-Assistant
Copy link
Contributor

OK, merging this PR

@Normation-Quality-Assistant Normation-Quality-Assistant merged commit d26155d into Normation:branches/rudder/4.1 Oct 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants