Skip to content

Commit 6f5eae1

Browse files
committed
Detect invalid hostgroup expressions
1 parent 4f4d649 commit 6f5eae1

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Revision history for Rex
44
[API CHANGES]
55

66
[BUG FIXES]
7+
- Detect invalid hostgroup expressions
78

89
[DOCUMENTATION]
910

lib/Rex/Commands.pm

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1786,9 +1786,12 @@ sub evaluate_hostname {
17861786
if ( $rule =~ m/,/ ) {
17871787
@ret = _evaluate_hostname_list( $start, $rule, $end );
17881788
}
1789-
else {
1789+
elsif ( $rule =~ m/[.]{2}/msx ) {
17901790
@ret = _evaluate_hostname_range( $start, $rule, $end );
17911791
}
1792+
else {
1793+
croak('Invalid hostgroup expression');
1794+
}
17921795

17931796
return @ret;
17941797
}

0 commit comments

Comments
 (0)