def DropPrivileges():
  """Attempt to drop privileges if required."""
  if config.CONFIG["Server.username"]:
    try:
      os.setuid(pwd.getpwnam(config.CONFIG["Server.username"]).pw_uid)
    except (KeyError, OSError):
      logging.exception("Unable to switch to user %s",
                        config.CONFIG["Server.username"])
      raise
def DropPrivileges ( ) : if config . CONFIG [ "Server.username" ] : try : os . setuid ( pwd . getpwnam ( config . CONFIG [ "Server.username" ] ) . pw_uid ) except ( KeyError , OSError ) : logging . exception ( "Unable to switch to user %s" , config . CONFIG [ "Server.username" ] ) raise
Attempt to drop privileges if required.