GNUPG = "/usr/bin/gpg"
GROUP_PATTERN = "@[a-zA-Z0-9-]+"
+USER_PATTERN = "[a-zA-Z0-9:-]+"
$program_name = File.basename($0, '.*')
$editor = ENV['EDITOR']
lno = lno+1
next if line =~ /^$/
next if line =~ /^#/
- if (m = /^([a-zA-Z0-9:-]+)\s*=\s*([0-9A-Fa-f]{40})\s*$/.match line)
+ if (m = /^(#{USER_PATTERN})\s*=\s*([0-9A-Fa-f]{40})\s*$/.match line)
user = m[1]
fpr = m[2]
if @users.has_key?(user)
if /^#/.match line
next
end
- m = /^access: "?(#{GROUP_PATTERN})"?/.match line
+ m = /^access: "?((?:(?:#{GROUP_PATTERN}|#{USER_PATTERN}),?\s*)+)"?/.match line
return [] unless m
return m[1].strip.split(/[\t ,]+/)
end