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

Comparing ircd-hybrid/trunk/src/s_auth.c (file contents):
Revision 3168 by michael, Sat Mar 15 23:46:08 2014 UTC vs.
Revision 3250 by michael, Sun Mar 30 20:47:30 2014 UTC

# Line 164 | Line 164 | auth_dns_callback(void *vptr, const stru
164  
165    ClearDNSPending(auth);
166  
167 <  if (name != NULL)
167 >  if (name)
168    {
169      const struct sockaddr_in *v4, *v4dns;
170   #ifdef IPV6
# Line 177 | Line 177 | auth_dns_callback(void *vptr, const stru
177      {
178        v6 = (const struct sockaddr_in6 *)&auth->client->localClient->ip;
179        v6dns = (const struct sockaddr_in6 *)addr;
180 +
181        if (memcmp(&v6->sin6_addr, &v6dns->sin6_addr, sizeof(struct in6_addr)) != 0)
182        {
183          sendheader(auth->client, REPORT_IP_MISMATCH);
# Line 188 | Line 189 | auth_dns_callback(void *vptr, const stru
189      {
190        v4 = (const struct sockaddr_in *)&auth->client->localClient->ip;
191        v4dns = (const struct sockaddr_in *)addr;
192 <      if(v4->sin_addr.s_addr != v4dns->sin_addr.s_addr)
192 >
193 >      if (v4->sin_addr.s_addr != v4dns->sin_addr.s_addr)
194        {
195          sendheader(auth->client, REPORT_IP_MISMATCH);
196          good = 0;
197        }
198      }
199 +
200      if (good && strlen(name) <= HOSTLEN)
201      {
202        strlcpy(auth->client->host, name,
# Line 364 | Line 367 | GetValidIdent(char *buf)
367   * side effects - starts auth (identd) and dns queries for a client
368   */
369   void
370 < start_auth(struct Client *client)
370 > start_auth(struct Client *client_p)
371   {
372    struct AuthRequest *auth = NULL;
373  
374 <  assert(client != NULL);
374 >  assert(client_p);
375  
376 <  auth = make_auth_request(client);
376 >  auth = make_auth_request(client_p);
377    SetInAuth(auth);
378    dlinkAddTail(auth, &auth->node, &auth_doing_list);
379  
380 <  sendheader(client, REPORT_DO_DNS);
380 >  sendheader(client_p, REPORT_DO_DNS);
381  
382    SetDNSPending(auth);
383  
# Line 384 | Line 387 | start_auth(struct Client *client)
387      start_auth_query(auth);
388    }
389  
390 <  gethost_byaddr(auth_dns_callback, auth, &client->localClient->ip);
390 >  gethost_byaddr(auth_dns_callback, auth, &client_p->localClient->ip);
391   }
392  
393   /*
# Line 394 | Line 397 | start_auth(struct Client *client)
397   static void
398   timeout_auth_queries_event(void *notused)
399   {
400 <  dlink_node *ptr = NULL, *next_ptr = NULL;
400 >  dlink_node *ptr = NULL, *ptr_next = NULL;
401  
402 <  DLINK_FOREACH_SAFE(ptr, next_ptr, auth_doing_list.head)
402 >  DLINK_FOREACH_SAFE(ptr, ptr_next, auth_doing_list.head)
403    {
404      struct AuthRequest *auth = ptr->data;
405  
# Line 457 | Line 460 | auth_connect_callback(fde_t *fd, int err
460      return;
461    }
462  
463 <  if (getsockname(auth->client->localClient->fd.fd, (struct sockaddr *)&us,
464 <      &ulen) ||
462 <      getpeername(auth->client->localClient->fd.fd, (struct sockaddr *)&them,
463 <      &tlen))
463 >  if (getsockname(auth->client->localClient->fd.fd, (struct sockaddr *)&us, &ulen) ||
464 >      getpeername(auth->client->localClient->fd.fd, (struct sockaddr *)&them, &tlen))
465    {
466      ilog(LOG_TYPE_IRCD, "auth get{sock,peer}name error for %s",
467 <        get_client_name(auth->client, SHOW_IP));
467 >         get_client_name(auth->client, SHOW_IP));
468      auth_error(auth);
469      return;
470    }

Diff Legend

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