irc-server: do not remove hostnames from info text

that code does not really make sense -- the info
text is freely cofngiureable and des not follow a specific
format.

Also, that "+2" might have caused invalid memory accesses.
This commit is contained in:
Florian Westphal 2009-04-22 23:15:17 +02:00
parent 84eaed6c9a
commit b545d38ae4
1 changed files with 2 additions and 6 deletions

View File

@ -49,7 +49,7 @@
GLOBAL bool GLOBAL bool
IRC_SERVER( CLIENT *Client, REQUEST *Req ) IRC_SERVER( CLIENT *Client, REQUEST *Req )
{ {
char str[LINE_LEN], *ptr; char str[LINE_LEN];
CLIENT *from, *c; CLIENT *from, *c;
bool ok; bool ok;
int i; int i;
@ -168,10 +168,6 @@ IRC_SERVER( CLIENT *Client, REQUEST *Req )
/* check for existing server with same ID */ /* check for existing server with same ID */
if( ! Client_CheckID( Client, Req->argv[0] )) return DISCONNECTED; if( ! Client_CheckID( Client, Req->argv[0] )) return DISCONNECTED;
/* remove superfluous hostnames from Info-Text */
ptr = strchr( Req->argv[3] + 2, '[' );
if( ! ptr ) ptr = Req->argv[3];
from = Client_Search( Req->prefix ); from = Client_Search( Req->prefix );
if( ! from ) if( ! from )
{ {
@ -181,7 +177,7 @@ IRC_SERVER( CLIENT *Client, REQUEST *Req )
return DISCONNECTED; return DISCONNECTED;
} }
c = Client_NewRemoteServer( Client, Req->argv[0], from, atoi( Req->argv[1] ), atoi( Req->argv[2] ), ptr, true); c = Client_NewRemoteServer(Client, Req->argv[0], from, atoi(Req->argv[1]), atoi(Req->argv[2]), Req->argv[3], true);
if (!c) { if (!c) {
Log( LOG_ALERT, "Can't create client structure for server! (on connection %d)", Client_Conn( Client )); Log( LOG_ALERT, "Can't create client structure for server! (on connection %d)", Client_Conn( Client ));
Conn_Close( Client_Conn( Client ), NULL, "Can't allocate client structure for remote server", true); Conn_Close( Client_Conn( Client ), NULL, "Can't allocate client structure for remote server", true);