+2002-04-03 Alex Badea <vampire@p16.pub.ro>
+
+ * include/s_user.h: added a sptr parameter to InfoFormatter
+ function type
+
+ * ircd/m_who.c: don't match IPs for clients which have a hidden host,
+ except when the inquiring user is an oper
+
+ * ircd/whocmds.c: show the fake IP from FEAT_HIDDEN_IP if the
+ target has a hidden host, but show real IP to opers
+
+ * ircd/m_userip.c (userip_formatter): add sptr parameter; show the
+ fake IP from FEAT_HIDDEN_IP if the target has a hidden host, but
+ show real IP to opers
+
+ * ircd/m_userhost.c (userhost_formatter): add (unused) sptr parameter
+
+ * ircd/s_user.c (send_user_info): pass sptr to the formatting function
+
+ * include/ircd_features.h: new feature FEAT_HIDDEN_IP (stores which
+ fake IP to show for clients with a hidden host)
+
+ * ircd/ircd_features.c: new feature FEAT_HIDDEN_IP
+
+ * doc/example.conf: default value for FEAT_HIDDEN_IP
+
+ * doc/readme.features: documented FEAT_HIDDEN_IP
+
2002-04-03 Andrew Miller <a1kmm@mware.virtualave.net>
* doc/example.conf: Cleaned up some comments that ended up in
strange places due to problems in the merge process.
# "NICKNAMEHISTORYLENGTH"="800";
# "HOST_HIDING"="FALSE";
# "HIDDEN_HOST"="users.undernet.org";
+# "HIDDEN_IP"="127.0.0.1";
# "KILLCHASETIMELIMIT"="30";
# "MAXCHANNELSPERUSER"="10";
# "AVBANLEN"="40";
This selects the suffix for the hidden hostmask (see HOST_HIDING).
+HIDDEN_IP
+ * Type: string
+ * Default: 127.0.0.1
+
+This selects a fake IP to be shown on /USERIP and /WHO %i when the
+target has a hidden host (see HOST_HIDING).
+
KILLCHASETIMELIMIT
* Type: integer
* Default: 30
FEAT_NICKNAMEHISTORYLENGTH,
FEAT_HOST_HIDING,
FEAT_HIDDEN_HOST,
+ FEAT_HIDDEN_IP,
/* features that probably should not be touched */
FEAT_KILLCHASETIMELIMIT,
extern struct SLink *opsarray[];
-typedef void (*InfoFormatter)(struct Client* who, struct MsgBuf* buf);
+typedef void (*InfoFormatter)(struct Client* who, struct Client *sptr, struct MsgBuf* buf);
/*
* Prototypes
F_I(NICKNAMEHISTORYLENGTH, 0, 800, whowas_realloc),
F_B(HOST_HIDING, 0, 0, 0),
F_S(HIDDEN_HOST, FEAT_CASE, "users.undernet.org", 0),
+ F_S(HIDDEN_IP, 0, "127.0.0.1", 0),
/* features that probably should not be touched */
F_I(KILLCHASETIMELIMIT, 0, 30, 0),
#include <assert.h>
-static void userhost_formatter(struct Client* cptr, struct MsgBuf* mb)
+static void userhost_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),
#include "client.h"
#include "ircd_reply.h"
#include "ircd_string.h"
+#include "ircd_features.h"
#include "msgq.h"
#include "numeric.h"
#include "s_user.h"
#include <assert.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) ? "*" : "",
cli_user(cptr)->away ? '-' : '+', cli_user(cptr)->username,
- HasHiddenHost(cptr) ? "127.0.0.1" :
+ HasHiddenHost(cptr) && !IsAnOper(sptr) ?
+ feature_str(FEAT_HIDDEN_IP) :
ircd_ntoa((const char*) &(cli_ip(cptr))));
}
&& ((!(matchsel & WHO_FIELD_REN))
|| matchexec(cli_info(acptr), mymask, minlen))
&& ((!(matchsel & WHO_FIELD_NIP))
+ || (HasHiddenHost(acptr) && !IsAnOper(sptr))
|| ((((cli_ip(acptr).s_addr & imask.mask.s_addr) !=
imask.bits.s_addr)) || (imask.fall
&& matchexec(ircd_ntoa((const char*) &(cli_ip(acptr))), mymask, minlen)))))
&& ((!(matchsel & WHO_FIELD_REN))
|| matchexec(cli_info(acptr), mymask, minlen))
&& ((!(matchsel & WHO_FIELD_NIP))
+ || (HasHiddenHost(acptr) && !IsAnOper(sptr))
|| ((((cli_ip(acptr).s_addr & imask.mask.s_addr) != imask.bits.s_addr))
|| (imask.fall
&& matchexec(ircd_ntoa((const char*) &(cli_ip(acptr))), mymask, minlen)))))
if ((acptr = FindUser(name))) {
if (users_found++)
msgq_append(0, mb, " ");
- (*fmt)(acptr, mb);
+ (*fmt)(acptr, sptr, mb);
}
if (5 == ++arg_count)
break;
if (fields & WHO_FIELD_NIP)
{
- const char* p2 = ircd_ntoa((const char*) &(cli_ip(acptr)));
+ const char* p2 = HasHiddenHost(acptr) && !IsAnOper(sptr) ?
+ feature_str(FEAT_HIDDEN_IP) :
+ ircd_ntoa((const char*) &(cli_ip(acptr)));
*(p1++) = ' ';
while ((*p2) && (*(p1++) = *(p2++)));
}