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-7.2/modules/m_userhost.c (file contents):
Revision 267 by lusky, Sun Oct 2 21:05:51 2005 UTC vs.
Revision 268 by adx, Mon Nov 14 11:02:39 2005 UTC

# Line 93 | Line 93 | m_userhost(struct Client *client_p, stru
93             * lookup (USERHOST) to figure out what the clients' local IP
94             * is.  Useful for things like NAT, and dynamic dial-up users.
95             */
96 <          /*
97 <           * If a lazyleaf relayed us this request, we don't know
98 <           * the clients real IP.
99 <           * So, if you're on a lazyleaf, and you send a userhost
100 <           * including your nick and the nick of someone not known to
101 <           * the leaf, you'll get your spoofed IP.  tough.
102 <           */
96 >      /*
97 >       * If a lazyleaf relayed us this request, we don't know
98 >       * the clients real IP.
99 >       * So, if you're on a lazyleaf, and you send a userhost
100 >       * including your nick and the nick of someone not known to
101 >       * the leaf, you'll get your spoofed IP.  tough.
102 >       */
103            if (MyClient(target_p) && (target_p == source_p))
104            {
105              rl = ircsprintf(response, "%s%s=%c%s@%s ",
# Line 109 | Line 109 | m_userhost(struct Client *client_p, stru
109                              target_p->username,
110                              target_p->sockhost);
111            }
112 <          else
112 >      else
113            {
114              rl = ircsprintf(response, "%s%s=%c%s@%s ",
115                              target_p->name,
# Line 120 | Line 120 | m_userhost(struct Client *client_p, stru
120            }
121  
122            if ((rl + cur_len) < (IRCD_BUFSIZE-10))
123 <          {
124 <              ircsprintf(t,"%s",response);
125 <              t += rl;
126 <              cur_len += rl;
127 <          }
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) )
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 <          t = buf;
139 <          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;
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      }
148 +  }
149  
150    sendto_one(source_p, "%s", buf);
151   }

Diff Legend

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