module WEBrick::Utils

def su(user)

Changes the process's uid and gid to the ones of +user+
#
def su(user)
  if pw = Etc.getpwnam(user)
    Process::initgroups(user, pw.gid)
    Process::Sys::setgid(pw.gid)
    Process::Sys::setuid(pw.uid)
  else
    warn("WEBrick::Utils::su doesn't work on this platform", uplevel: 1)
  end
end