def DropPrivileges():
  if config_lib.CONFIG["Server.username"]:
    try:
      os.setuid(pwd.getpwnam(config_lib.CONFIG["Server.username"]).pw_uid)
    except (KeyError, OSError):
      logging.exception("Unable to switch to user %s",
                        config_lib.CONFIG["Server.username"])
      raise
Attempt to drop privileges if required.
dataset/ETHPy150Open google/grr/grr/lib/startup.py/DropPrivileges