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

void CUser::LogBadLogin ( sockaddr *  Peer  ) 

LogBadLogin

Logs a bad login attempt.

Parameters:
Peer the IP address of the client

Definition at line 1287 of file User.cpp.

References badlogin_s::Address, badlogin_s::Count, and m_BadLogins.

Referenced by CClientConnection::ValidateUser().

                                      {
      badlogin_t BadLogin;

      for (unsigned int i = 0; i < m_BadLogins.GetLength(); i++) {
            if (CompareAddress(m_BadLogins[i].Address, Peer) == 0 && m_BadLogins[i].Count < 3) {
                  m_BadLogins[i].Count++;

                  return;
            }
      }

      BadLogin.Count = 1;
      BadLogin.Address = (sockaddr *)umalloc(SOCKADDR_LEN(Peer->sa_family));

      CHECK_ALLOC_RESULT(BadLogin.Address, umalloc) {
            return;
      } CHECK_ALLOC_RESULT_END;

      mmark(BadLogin.Address);
      memcpy(BadLogin.Address, Peer, SOCKADDR_LEN(Peer->sa_family));

      m_BadLogins.Insert(BadLogin);
}


Generated by  Doxygen 1.6.0   Back to index