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

Comparing:
ircd-hybrid/modules/m_userhost.c (file contents), Revision 30 by adx, Sun Oct 2 20:03:27 2005 UTC vs.
ircd-hybrid-7.3/modules/m_userhost.c (file contents), Revision 1121 by michael, Sun Jan 9 11:03:03 2011 UTC

# Line 19 | Line 19
19   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
20   *  USA
21   *
22 < *  $Id: m_userhost.c,v 1.44 2005/08/17 16:02:51 michael Exp $
22 > *  $Id$
23   */
24  
25   #include "stdinc.h"
# Line 44 | Line 44 | struct Message userhost_msgtab = {
44    {m_unregistered, m_userhost, m_userhost, m_ignore, m_userhost, m_ignore}
45   };
46  
47 #ifndef STATIC_MODULES
47   void
48   _modinit(void)
49   {
# Line 57 | Line 56 | _moddeinit(void)
56    mod_del_cmd(&userhost_msgtab);
57   }
58  
59 < const char *_version = "$Revision: 1.44 $";
61 < #endif
59 > const char *_version = "$Revision$";
60  
61   /*
62   * m_userhost added by Darren Reed 13/8/91 to aid clients and reduce
# Line 73 | Line 71 | m_userhost(struct Client *client_p, stru
71    char buf[IRCD_BUFSIZE];
72    char response[NICKLEN*2+USERLEN+HOSTLEN+30];
73    char *t;
74 <  int i, n;               /* loop counter */
74 >  int i;               /* loop counter */
75    int cur_len;
76    int rl;
77  
# Line 82 | Line 80 | m_userhost(struct Client *client_p, stru
80  
81    for (i = 0; i < 5; i++)
82    {
83 <    if (parv[i+1] == NULL)
83 >    if (parv[i + 1] == NULL)
84        break;
85  
86      if ((target_p = find_person(client_p, parv[i+1])) != NULL)
87      {
88 <          /*
89 <           * Show real IP for USERHOST on yourself.
90 <           * This is needed for things like mIRC, which do a server-based
91 <           * lookup (USERHOST) to figure out what the clients' local IP
92 <           * is.  Useful for things like NAT, and dynamic dial-up users.
93 <           */
94 <          /*
95 <           * If a lazyleaf relayed us this request, we don't know
96 <           * the clients real IP.
97 <           * So, if you're on a lazyleaf, and you send a userhost
98 <           * including your nick and the nick of someone not known to
99 <           * the leaf, you'll get your spoofed IP.  tough.
100 <           */
101 <          if (MyClient(target_p) && (target_p == source_p))
102 <          {
103 <            rl = ircsprintf(response, "%s%s=%c%s@%s ",
104 <                            target_p->name,
105 <                            IsOper(target_p) ? "*" : "",
106 <                            (target_p->away) ? '-' : '+',
107 <                            target_p->username,
108 <                            target_p->sockhost);
109 <          }
110 <          else
111 <          {
112 <            rl = ircsprintf(response, "%s%s=%c%s@%s ",
113 <                            target_p->name,
114 <                            IsOper(target_p) ? "*" : "",
115 <                            (target_p->away) ? '-' : '+',
116 <                            target_p->username,
117 <                            target_p->host);
118 <          }
119 <
120 <          if ((rl + cur_len) < (IRCD_BUFSIZE-10))
123 <          {
124 <              ircsprintf(t,"%s",response);
125 <              t += rl;
126 <              cur_len += rl;
127 <          }
128 <          else
129 <            break;
130 <        }
131 <      else if ( !ServerInfo.hub && uplink && IsCapable(uplink, CAP_LL) )
132 <        {
133 <          t = buf;
134 <          for( n = 0; n < 5; n++ )
135 <          {
136 <            if( parv[n+1] )
137 <            {
138 <              rl = ircsprintf(t, "%s ", parv[n+1]);
139 <              t += rl;
140 <            }
141 <            else
142 <              break;
143 <          }
144 <          /* Relay upstream, and let hub reply */
145 <          sendto_one(uplink, ":%s USERHOST %s", parv[0], buf );
146 <          return;
147 <        }
88 >      /*
89 >       * Show real IP for USERHOST on yourself.
90 >       * This is needed for things like mIRC, which do a server-based
91 >       * lookup (USERHOST) to figure out what the clients' local IP
92 >       * is.  Useful for things like NAT, and dynamic dial-up users.
93 >       */
94 >      if (MyClient(target_p) && (target_p == source_p))
95 >      {
96 >        rl = ircsprintf(response, "%s%s=%c%s@%s ",
97 >                        target_p->name,
98 >                        IsOper(target_p) ? "*" : "",
99 >                        (target_p->away) ? '-' : '+',
100 >                        target_p->username,
101 >                        target_p->sockhost);
102 >      }
103 >      else
104 >      {
105 >        rl = ircsprintf(response, "%s%s=%c%s@%s ",
106 >                        target_p->name,
107 >                        IsOper(target_p) ? "*" : "",
108 >                        (target_p->away) ? '-' : '+',
109 >                        target_p->username,
110 >                        target_p->host);
111 >      }
112 >
113 >      if ((rl + cur_len) < (IRCD_BUFSIZE - 10))
114 >      {
115 >        ircsprintf(t, "%s", response);
116 >        t += rl;
117 >        cur_len += rl;
118 >      }
119 >      else
120 >        break;
121      }
122 +  }
123  
124    sendto_one(source_p, "%s", buf);
125   }

Comparing:
ircd-hybrid/modules/m_userhost.c (property svn:keywords), Revision 30 by adx, Sun Oct 2 20:03:27 2005 UTC vs.
ircd-hybrid-7.3/modules/m_userhost.c (property svn:keywords), Revision 1121 by michael, Sun Jan 9 11:03:03 2011 UTC

# Line 1 | Line 1
1 < "Id Revision"
1 > Id Revision

Diff Legend

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