Skip to content

Commit a22ba0e

Browse files
authored
Merge pull request #1019 from cmd-ntrf/bug11203
Bugfix MODULES-11203: error on second apply when uid or gid is specified as a range
2 parents 4699cd5 + 6ee37ea commit a22ba0e

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

lib/puppet/type/firewall.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1390,17 +1390,17 @@ def insync?(is)
13901390
should_negate = '!'
13911391
end
13921392

1393-
# If 'should' contains anything other than digits,
1393+
# If 'should' contains anything other than digits or digit range,
13941394
# we assume that we have to do a lookup to convert
13951395
# to UID
1396-
unless should[%r{[0-9]+}] == should
1396+
unless should[%r{[0-9]+(-[0-9]+)?}] == should
13971397
should = Etc.getpwnam(should).uid
13981398
end
13991399

1400-
# If 'is' contains anything other than digits,
1400+
# If 'is' contains anything other than digits or digit range,
14011401
# we assume that we have to do a lookup to convert
14021402
# to UID
1403-
unless is[%r{[0-9]+}] == is
1403+
unless is[%r{[0-9]+(-[0-9]+)?}] == is
14041404
is = Etc.getpwnam(is).uid
14051405
end
14061406

@@ -1439,17 +1439,17 @@ def insync?(is)
14391439
should_negate = '!'
14401440
end
14411441

1442-
# If 'should' contains anything other than digits,
1442+
# If 'should' contains anything other than digits or digit range,
14431443
# we assume that we have to do a lookup to convert
1444-
# to UID
1445-
unless should[%r{[0-9]+}] == should
1444+
# to GID
1445+
unless should[%r{[0-9]+(-[0-9]+)?}] == should
14461446
should = Etc.getgrnam(should).gid
14471447
end
14481448

1449-
# If 'is' contains anything other than digits,
1449+
# If 'is' contains anything other than digits or digit range,
14501450
# we assume that we have to do a lookup to convert
1451-
# to UID
1452-
unless is[%r{[0-9]+}] == is
1451+
# to GID
1452+
unless is[%r{[0-9]+(-[0-9]+)?}] == is
14531453
is = Etc.getgrnam(is).gid
14541454
end
14551455

0 commit comments

Comments
 (0)