]> arthur.barton.de Git - ngircd.git/commitdiff
WEBIRC: Don't respect hostname when DNS is disabled
authorAlexander Barton <alex@barton.de>
Fri, 27 Dec 2013 21:34:47 +0000 (22:34 +0100)
committerAlexander Barton <alex@barton.de>
Wed, 19 Mar 2014 01:07:05 +0000 (02:07 +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.

(cherry picked from commit 1a628fff51fcfddde391e6c0f27686835e1b6d2e)

src/ngircd/irc-login.c

index 469527209ac2dfdf423014c26fc3d4b0a116104a..dc2f6e391501c5cc329251413c56a58db64f5c8f 100644 (file)
@@ -613,7 +613,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;