Fixed keytab generation when key number is over 10 and improved checking of principals in keytab.
This commit is contained in:
parent
594c24a174
commit
9def142f98
1 changed files with 6 additions and 6 deletions
|
@ -20,16 +20,16 @@ def check_keytab(config, keytab, principals)
|
|||
entries = []
|
||||
IO.popen(sprintf('%s -k %s', config['klist'], keytab), mode='r') { |f|
|
||||
f.readlines.each do |l|
|
||||
next unless l =~ / \d+ .*/
|
||||
next unless l =~ /[ ]+\d+ .*/
|
||||
entries << l.split()[1]
|
||||
end
|
||||
}
|
||||
t = principals & entries.uniq
|
||||
if t.size != principals.size
|
||||
return false
|
||||
else
|
||||
return true
|
||||
principals.each do |p|
|
||||
if not entries.include?(p)
|
||||
return false
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue