module Mixlib::ShellOut::Unix

def sgids

to the user's secondary groups
Currently valid only if login is used, and is set
The secondary groups that the subprocess will switch to.
def sgids
  return nil unless using_login?
  user_name = Etc.getpwuid(uid).name
  all_seconderies.select{|g| g.mem.include?(user_name)}.map{|g|g.gid}
end