#include "client.h"
#include "ircd_reply.h"
#include "ircd_string.h"
+#include "ircd_features.h"
+#include "ircd_log.h"
#include "msgq.h"
#include "numeric.h"
#include "s_user.h"
#include "struct.h"
-#include <assert.h>
+/* #include <assert.h> -- Now using assert in ircd_log.h */
-static void userip_formatter(struct Client* cptr, struct MsgBuf* mb)
+static void userip_formatter(struct Client* cptr, struct Client *sptr, struct MsgBuf* mb)
{
assert(IsUser(cptr));
msgq_append(0, mb, "%s%s=%c%s@%s", cli_name(cptr),
- HasPriv(cptr, PRIV_DISPLAY) ? "*" : "",
+ SeeOper(sptr,cptr) ? "*" : "",
cli_user(cptr)->away ? '-' : '+', cli_user(cptr)->username,
- HasHiddenHost(cptr) ? "127.0.0.1" :
- ircd_ntoa((const char*) &(cli_ip(cptr))));
+ /* Do not *EVER* change this to give opers the real IP.
+ * Too many scripts rely on this data and can inadvertently
+ * publish the user's real IP, thus breaking the security
+ * of +x. If an oper wants the real IP, he should go to
+ * /whois to get it.
+ */
+ HasHiddenHost(cptr) && (sptr != cptr) ?
+ feature_str(FEAT_HIDDEN_IP) :
+ ircd_ntoa(&cli_ip(cptr)));
}
/*