code: def drop_privileges ():
      
      if os.name != 'posix':
          return
      if os.geteuid() == 0:
          log.warn(LOG_CHECK, _("Running as root user; "
                         "dropping privileges by changing user to nobody."))
          import pwd
          os.seteuid(pwd.getpwnam('nobody')[3])
docs: Make sure to drop root privileges on POSIX systems.