mirror of
https://github.com/debauchee/barrier.git
synced 2026-05-08 14:41:57 +08:00
server now rejects clients that are not in the configuration.
added a protocol message to indicate this.
This commit is contained in:
@@ -992,6 +992,11 @@ void CServer::handshakeClient(void* vsocket)
|
||||
log((CLOG_WARN "a client with name \"%s\" is already connected", e.getName().c_str()));
|
||||
CProtocolUtil::writef(output.get(), kMsgEBusy);
|
||||
}
|
||||
catch (XUnknownClient& e) {
|
||||
// client has unknown name
|
||||
log((CLOG_WARN "a client with name \"%s\" is not in the map", e.getName().c_str()));
|
||||
CProtocolUtil::writef(output.get(), kMsgEUnknown);
|
||||
}
|
||||
catch (XIncompatibleClient& e) {
|
||||
// client is incompatible
|
||||
// FIXME -- could print network address if socket had suitable method
|
||||
@@ -1278,7 +1283,10 @@ CServer::CScreenInfo* CServer::addConnection(
|
||||
throw XDuplicateClient(name);
|
||||
}
|
||||
|
||||
// FIXME -- throw if the name is not in our map
|
||||
// name must be in our configuration
|
||||
if (!m_config.isScreen(name)) {
|
||||
throw XUnknownClient(name);
|
||||
}
|
||||
|
||||
// save screen info
|
||||
CScreenInfo* newScreen = new CScreenInfo(name, protocol);
|
||||
|
||||
Reference in New Issue
Block a user