Skip to content
Snippets Groups Projects
Commit 9f4cec35 authored by Adam Lewenberg's avatar Adam Lewenberg
Browse files

handle situation where line from password file does not match regex

parent 411bc3a9
No related branches found
No related tags found
No related merge requests found
unreleased (2014-04-??)
Fix error if line read from password file does not match
regular expression. (adamhl)
release/001.001 (2014-03-17)
Added the custom facts "regular_users" and "root_users". See the file
......
......@@ -16,7 +16,7 @@ Facter.add("regular_users") do
lines.each do |l|
# games:x:5:60:games:/usr/games:/bin/sh
match = /^([^:]+):([^:]+):(\d+):(\d+):/.match(l)
if (match.length >= 3)
if ((!match.nil?) && match.length >= 3)
name = match[1]
id = match[3]
group = match[4]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment