WEBIRC: Don't respect hostname when DNS is disabled bug167-WebircIPAnoDNS
authorAlexander Barton <alex@barton.de>
Fri, 27 Dec 2013 21:34:47 +0000 (22:34 +0100)
committerAlexander Barton <alex@barton.de>
Fri, 27 Dec 2013 21:34:47 +0000 (22:34 +0100)
When DNS lookups are disabled, don't set the hostname received by the
WEBIRC command, but use the IP address instead.

Reported by Toni Spets <toni.spets@iki.fi>, thanks!

Closes bug #167.

src/ngircd/irc-login.c

index 9e7e2d7a9a9a21a9beb4584748f6cd05628966b4..b7fe5feda3339b9659012f7352563a8c2af3b8cf 100644 (file)
@@ -609,7 +609,10 @@ IRC_WEBIRC(CLIENT *Client, REQUEST *Req)
 
        Client_SetUser(Client, Req->argv[1], true);
        Client_SetOrigUser(Client, Req->argv[1]);
-       Client_SetHostname(Client, Req->argv[2]);
+       if (Conf_DNS)
+               Client_SetHostname(Client, Req->argv[2]);
+       else
+               Client_SetHostname(Client, Req->argv[3]);
        Client_SetIPAText(Client, Req->argv[3]);
 
        return CONNECTED;