diff options
Diffstat (limited to 'servers/auth_server_lin/src/auth_conn.cpp')
| -rw-r--r-- | servers/auth_server_lin/src/auth_conn.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/servers/auth_server_lin/src/auth_conn.cpp b/servers/auth_server_lin/src/auth_conn.cpp index 28b79fb..b71b608 100644 --- a/servers/auth_server_lin/src/auth_conn.cpp +++ b/servers/auth_server_lin/src/auth_conn.cpp @@ -38,7 +38,9 @@ struct exit_exception { instance of this class. */ AuthSocket::AuthSocket(int sock, TQObject *parent, const char *name) : - TDEKerberosServerSocket(parent, name), m_criticalSection(0), m_stationID(-1), m_config(static_cast<AuthServer*>(parent)->m_config), m_database(NULL), m_databaseStationsCursor(NULL) { + TDEKerberosServerSocket(parent, name), m_criticalSection(0), m_stationID(-1), m_config(static_cast<AuthServer*>(parent)->m_config), m_database(NULL), m_databaseStationsCursor(NULL), + m_databaseServicesCursor(NULL), m_databaseServiceTypesCursor(NULL), m_databasePermissionsCursor(NULL), m_databaseActivityCursor(NULL) +{ setServiceName("remotefpga"); @@ -75,8 +77,10 @@ AuthSocket::~AuthSocket() { } void AuthSocket::close() { - TDEKerberosServerSocket::close(); - connectionClosedHandler(); + if (state() == TQSocket::Connected) { + TDEKerberosServerSocket::close(); + connectionClosedHandler(); + } } void AuthSocket::connectionClosedHandler() { @@ -215,7 +219,6 @@ int AuthSocket::enterCommandLoop() { m_criticalSection--; return -1; } - } int AuthSocket::connectToDatabase() { @@ -314,9 +317,11 @@ void AuthServer::newConnection(int socket) { s->m_remoteHost = s->peerAddress().toString(); printf("[DEBUG] New connection from %s\n\r", s->m_remoteHost.ascii()); if (s->initiateKerberosHandshake() != 0) { + printf("[DEBUG] Connection from %s closed due to Kerberos failure\n\r", s->m_remoteHost.ascii()); s->close(); delete s; s = NULL; + return; } else { connect(s, SIGNAL(connectionClosed()), s, SLOT(deleteLater())); |
