ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/modules/m_stats.c
(Generate patch)

Comparing ircd-hybrid/trunk/modules/m_stats.c (file contents):
Revision 7616 by michael, Wed Jun 22 11:31:47 2016 UTC vs.
Revision 7652 by michael, Mon Jul 18 16:23:28 2016 UTC

# Line 1148 | Line 1148 | stats_L_list(struct Client *source_p, co
1148  
1149    /*
1150     * Send info about connections which match, or all if the
1151 <   * mask matches from. Only restrictions are on those who
1152 <   * are invisible not being visible to 'foreigners' who use
1153 <   * a wild card based search to list it.
1151 >   * mask matches from.
1152     */
1153    DLINK_FOREACH(node, list->head)
1154    {
1155      const struct Client *target_p = node->data;
1156 <
1159 <    if (HasUMode(target_p, UMODE_INVISIBLE) && (doall || wilds) &&
1160 <        !(MyConnect(source_p) && HasUMode(source_p, UMODE_OPER)) &&
1161 <        !HasUMode(target_p, UMODE_OPER) && (target_p != source_p))
1162 <      continue;
1156 >    enum addr_mask_type type = 0;
1157  
1158      if (!doall && wilds && match(name, target_p->name))
1159        continue;
# Line 1167 | Line 1161 | stats_L_list(struct Client *source_p, co
1161      if (!(doall || wilds) && irccmp(name, target_p->name))
1162        continue;
1163  
1164 <    /*
1165 <     * This basically shows ips for our opers if it's not a server/admin, or
1172 <     * it's one of our admins.
1173 <     */
1174 <    if (MyConnect(source_p) && HasUMode(source_p, UMODE_OPER) &&
1175 <        (HasUMode(source_p, UMODE_ADMIN) ||
1176 <        (!IsServer(target_p) && !HasUMode(target_p, UMODE_ADMIN) &&
1177 <        !IsHandshake(target_p) && !IsConnecting(target_p))))
1178 <    {
1179 <      sendto_one_numeric(source_p, &me, RPL_STATSLINKINFO,
1180 <                 (IsUpper(statchar)) ?
1181 <                 get_client_name(target_p, SHOW_IP) :
1182 <                 get_client_name(target_p, HIDE_IP),
1183 <                 dbuf_length(&target_p->connection->buf_sendq),
1184 <                 target_p->connection->send.messages,
1185 <                 target_p->connection->send.bytes >> 10,
1186 <                 target_p->connection->recv.messages,
1187 <                 target_p->connection->recv.bytes >> 10,
1188 <                 (unsigned int)(CurrentTime - target_p->connection->firsttime),
1189 <                 (CurrentTime > target_p->connection->since) ? (unsigned int)(CurrentTime - target_p->connection->since) : 0,
1190 <                 IsServer(target_p) ? get_capabilities(target_p) : "-");
1191 <    }
1164 >    if (IsUpper(statchar))
1165 >      type = SHOW_IP;
1166      else
1167 <    {
1168 <      /* If it's a server, mask the real IP */
1169 <      if (IsServer(target_p) || IsHandshake(target_p) || IsConnecting(target_p))
1170 <        sendto_one_numeric(source_p, &me, RPL_STATSLINKINFO,
1171 <                   get_client_name(target_p, MASK_IP),
1172 <                   dbuf_length(&target_p->connection->buf_sendq),
1173 <                   target_p->connection->send.messages,
1174 <                   target_p->connection->send.bytes >> 10,
1175 <                   target_p->connection->recv.messages,
1176 <                   target_p->connection->recv.bytes >> 10,
1177 <                   (unsigned int)(CurrentTime - target_p->connection->firsttime),
1178 <                   (CurrentTime > target_p->connection->since) ? (unsigned int)(CurrentTime - target_p->connection->since):0,
1179 <                   IsServer(target_p) ? get_capabilities(target_p) : "-");
1180 <      else /* show the real IP */
1181 <        sendto_one_numeric(source_p, &me, RPL_STATSLINKINFO,
1182 <                   (IsUpper(statchar)) ?
1209 <                   get_client_name(target_p, SHOW_IP) :
1210 <                   get_client_name(target_p, HIDE_IP),
1211 <                   dbuf_length(&target_p->connection->buf_sendq),
1212 <                   target_p->connection->send.messages,
1213 <                   target_p->connection->send.bytes >> 10,
1214 <                   target_p->connection->recv.messages,
1215 <                   target_p->connection->recv.bytes >> 10,
1216 <                   (unsigned int)(CurrentTime - target_p->connection->firsttime),
1217 <                   (CurrentTime > target_p->connection->since) ? (unsigned int)(CurrentTime - target_p->connection->since):0,
1218 <                   IsServer(target_p) ? get_capabilities(target_p) : "-");
1219 <    }
1167 >      type = HIDE_IP;
1168 >
1169 >    if (IsServer(target_p) || IsConnecting(target_p) || IsHandshake(target_p))
1170 >      if (ConfigServerHide.hide_server_ips || !HasUMode(source_p, UMODE_ADMIN))
1171 >        type = MASK_IP;
1172 >
1173 >    sendto_one_numeric(source_p, &me, RPL_STATSLINKINFO,
1174 >                       get_client_name(target_p, type),
1175 >                       dbuf_length(&target_p->connection->buf_sendq),
1176 >                       target_p->connection->send.messages,
1177 >                       target_p->connection->send.bytes >> 10,
1178 >                       target_p->connection->recv.messages,
1179 >                       target_p->connection->recv.bytes >> 10,
1180 >                       (unsigned int)(CurrentTime - target_p->connection->firsttime),
1181 >                       (CurrentTime > target_p->connection->since) ? (unsigned int)(CurrentTime - target_p->connection->since) : 0,
1182 >                       IsServer(target_p) ? get_capabilities(target_p) : "-");
1183    }
1184   }
1185  

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)