Logo Search packages:      
Sourcecode: sbnc version File versions  Download package

void CCore::UpdateHosts ( void   )  [private]

UpdateHosts

Updates the "host allow" list in the config file.

Definition at line 2142 of file Core.cpp.

References Fatal(), CVector< Type >::GetLength(), m_Config, m_HostAllows, and CConfig::WriteString().

Referenced by AddHostAllow(), and RemoveHostAllow().

                            {
      char *Out;
      int a = 0;

      for (unsigned int i = 0; i < m_HostAllows.GetLength(); i++) {
            asprintf(&Out, "system.hosts.host%d", a++);

            CHECK_ALLOC_RESULT(Out, asprintf) {
                  g_Bouncer->Fatal();
            } CHECK_ALLOC_RESULT_END;

            m_Config->WriteString(Out, m_HostAllows[i]);
            free(Out);
      }

      asprintf(&Out, "system.hosts.host%d", a);

      CHECK_ALLOC_RESULT(Out, asprintf) {
            g_Bouncer->Fatal();
      } CHECK_ALLOC_RESULT_END;

      m_Config->WriteString(Out, NULL);
      free(Out);
}


Generated by  Doxygen 1.6.0   Back to index