X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=ircd%2Fs_user.c;h=98274901a99323a57bbc8225e07cf722aba4c71e;hb=3ff8f436014bfe342053877d3d063d181a753e3b;hp=f8d5b94e15ed72ae3ca6b8b4552735106acf83c2;hpb=73286bcf466860bb2d095e97b1a16e8a135b51d3;p=ircu2.10.12-pk.git diff --git a/ircd/s_user.c b/ircd/s_user.c index f8d5b94..9827490 100644 --- a/ircd/s_user.c +++ b/ircd/s_user.c @@ -972,6 +972,7 @@ void send_user_info(struct Client* sptr, char* names, int rpl, InfoFormatter fmt * @param[in] flag Some flag that affects host-hiding (FLAG_HIDDENHOST, FLAG_ACCOUNT, FLAG_FAKEHOST). * @return Zero. */ + int hide_hostmask(struct Client *cptr, unsigned int flag) { @@ -986,6 +987,7 @@ hide_hostmask(struct Client *cptr, unsigned int flag) break; case FLAG_ACCOUNT: case FLAG_FAKEHOST: + case FLAG_FAKEIDENT: /* Invalidate all bans against the user so we check them again */ for (chan = (cli_user(cptr))->channel; chan; chan = chan->next_channel) @@ -1005,7 +1007,7 @@ hide_hostmask(struct Client *cptr, unsigned int flag) if(IsFakeHost(cptr)) ircd_strncpy(buf, cli_user(cptr)->fakehost, HOSTLEN); else if (IsAccount(cptr)) ircd_snprintf(0, buf, HOSTLEN, "%s.%s", cli_user(cptr)->account, feature_str(FEAT_HIDDEN_HOST)); else return 0; - if(strncmp(buf, cli_user(cptr)->host, HOSTLEN) == 0) return 0; + if(strncmp(buf, cli_user(cptr)->host, HOSTLEN) == 0 && (!IsFakeIdent(cptr) || strncmp(cli_user(cptr)->fakeuser, cli_user(cptr)->username, USERLEN) == 0)) return 0; /* Remove all "valid" marks on the bans. This forces them to be * rechecked if the ban is accessed again. @@ -1018,9 +1020,17 @@ hide_hostmask(struct Client *cptr, unsigned int flag) sendcmdto_common_channels_butone(cptr, CMD_QUIT, cptr, ":Registered"); ircd_strncpy(cli_user(cptr)->host, buf, HOSTLEN); - /* ok, the client is now fully hidden, so let them know -- hikari */ - if (MyConnect(cptr)) - send_reply(cptr, RPL_HOSTHIDDEN, cli_user(cptr)->host); + /* spoof also the username if username is passed */ + if(IsFakeIdent(cptr)) { + ircd_strncpy(cli_user(cptr)->username, cli_user(cptr)->fakeuser, USERLEN); + /* ok, the client is now fully hidden, so let them know -- hikari */ + if (MyConnect(cptr)) + send_reply(cptr, RPL_HOSTUSERHIDDEN, cli_user(cptr)->username, cli_user(cptr)->host); + } else { + /* ok, the client is now fully hidden, so let them know -- hikari */ + if (MyConnect(cptr)) + send_reply(cptr, RPL_HOSTHIDDEN, cli_user(cptr)->host); + } /* * Go through all channels the client was on, rejoin him