]> err.no Git - pwstore/commitdiff
Allow "@group" in access lines too
authorTollef Fog Heen <tfheen@err.no>
Sun, 17 Jun 2012 07:33:01 +0000 (09:33 +0200)
committerTollef Fog Heen <tfheen@err.no>
Sun, 17 Jun 2012 07:33:01 +0000 (09:33 +0200)
pws

diff --git a/pws b/pws
index 3790b4f0982f425caddbeb6841557e3cc13dbf0a..430cfa2230788cf62b0dfdadc192fad660e0ad5d 100755 (executable)
--- a/pws
+++ b/pws
@@ -31,7 +31,7 @@ require 'yaml'
 Thread.abort_on_exception = true
 
 GNUPG = "/usr/bin/gpg"
-
+GROUP_PATTERN = "@[a-zA-Z0-9-]+"
 $program_name = File.basename($0, '.*')
 
 $editor = ENV['EDITOR']
@@ -297,7 +297,7 @@ class GroupConfig
           exit(1)
         end
         @users[user] = fpr
-      elsif (m = /^(@[a-zA-Z0-9-]+)\s*=\s*(.*)$/.match line)
+      elsif (m = /^(#{GROUP_PATTERN})\s*=\s*(.*)$/.match line)
         group = m[1]
         members = m[2].strip
         if @groups.has_key?(group)
@@ -414,7 +414,7 @@ class EncryptedFile
       if /^#/.match line
         next
       end
-      m = /^access: (.*)/.match line
+      m = /^access: "?(#{GROUP_PATTERN})"?/.match line
       return [] unless m
       return m[1].strip.split(/[\t ,]+/)
     end