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

Comparing ircd-hybrid-7.3/src/s_serv.c (file contents):
Revision 1029 by michael, Sun Nov 8 13:10:50 2009 UTC vs.
Revision 1115 by michael, Tue Dec 21 14:42:54 2010 UTC

# Line 562 | Line 562 | try_connections(void *unused)
562   }
563  
564   int
565 + valid_servname(const char *name)
566 + {
567 +  unsigned int length = 0;
568 +  unsigned int dots   = 0;
569 +  const char *p = name;
570 +
571 +  for (; *p; ++p)
572 +  {
573 +    if (!IsServChar(*p))
574 +      return 1;
575 +
576 +    ++length;
577 +
578 +    if (*p == '.')
579 +      ++dots;
580 +  }
581 +
582 +  return !dots || length > HOSTLEN;
583 + }
584 +
585 + int
586   check_server(const char *name, struct Client *client_p, int cryptlink)
587   {
588    dlink_node *ptr;
# Line 996 | Line 1017 | server_estab(struct Client *client_p)
1017      }
1018    }
1019  
1020 <  aconf = (struct AccessItem *)map_to_conf(conf);
1020 >  aconf = map_to_conf(conf);
1021  
1022    if (IsUnknown(client_p) && !IsConfCryptLink(aconf))
1023    {
# Line 1004 | Line 1025 | server_estab(struct Client *client_p)
1025       *        2.  Check aconf->spasswd, not aconf->passwd.
1026       */
1027      if (!EmptyString(aconf->spasswd))
1028 <    {
1029 <      /* only send ts6 format PASS if we have ts6 enabled */
1009 <    if (me.id[0] != '\0')               /* Send TS 6 form only if id */
1010 <        sendto_one(client_p, "PASS %s TS %d %s",
1011 <                   aconf->spasswd, TS_CURRENT, me.id);
1012 <      else
1013 <        sendto_one(client_p, "PASS %s TS 5",
1014 <                   aconf->spasswd);
1015 <    }
1028 >      sendto_one(client_p, "PASS %s TS %d %s",
1029 >                 aconf->spasswd, TS_CURRENT, me.id);
1030  
1031      /* Pass my info to the new server
1032       *
# Line 1038 | Line 1052 | server_estab(struct Client *client_p)
1052       */
1053      sendto_one(client_p, "SERVER %s 1 :%s%s",
1054                 my_name_for_link(conf),
1055 <               ConfigServerHide.hidden ? "(H) " : "",
1042 <               (me.info[0]) ? (me.info) : "IRCers United");
1055 >               ConfigServerHide.hidden ? "(H) " : "", me.info);
1056      send_queued_write(client_p);
1057    }
1058  
# Line 1063 | Line 1076 | server_estab(struct Client *client_p)
1076      SetServlink(client_p);
1077    }
1078  
1079 <  /* only send ts6 format SVINFO if we have ts6 enabled */
1067 <  sendto_one(client_p, "SVINFO %d %d 0 :%lu",
1068 <             (me.id[0] ? TS_CURRENT : 5), TS_MIN,
1079 >  sendto_one(client_p, "SVINFO %d %d 0 :%lu", TS_CURRENT, TS_MIN,
1080               (unsigned long)CurrentTime);
1081  
1082    /* assumption here is if they passed the correct TS version, they also passed an SID */
# Line 1636 | Line 1647 | serv_connect(struct AccessItem *aconf, s
1647    strlcpy(client_p->host, aconf->host, sizeof(client_p->host));
1648  
1649    /* We already converted the ip once, so lets use it - stu */
1650 <  strlcpy(client_p->sockhost, buf, HOSTIPLEN);
1650 >  strlcpy(client_p->sockhost, buf, sizeof(client_p->sockhost));
1651  
1652    /* create a socket for the server connection */
1653    if (comm_open(&client_p->localClient->fd, aconf->ipnum.ss.ss_family,
# Line 1846 | Line 1857 | serv_connect_callback(fde_t *fd, int sta
1857   #endif
1858  
1859    /* jdc -- Check and send spasswd, not passwd. */
1860 <  if (!EmptyString(aconf->spasswd) && (me.id[0] != '\0'))
1860 >  if (!EmptyString(aconf->spasswd))
1861        /* Send TS 6 form only if id */
1862      sendto_one(client_p, "PASS %s TS %d %s",
1863                 aconf->spasswd, TS_CURRENT, me.id);
1853  else
1854    sendto_one(client_p, "PASS %s TS 5",
1855               aconf->spasswd);
1864  
1865    /* Pass my info to the new server
1866     *
# Line 1975 | Line 1983 | cryptlink_init(struct Client *client_p,
1983                      | (IsConfCompressed(aconf) ? CAP_ZIP : 0)
1984                      | (IsConfTopicBurst(aconf) ? CAP_TBURST|CAP_TB : 0), CAP_ENC_MASK);
1985  
1986 <  if (me.id[0])
1979 <    sendto_one(client_p, "PASS . TS %d %s", TS_CURRENT, me.id);
1980 <
1986 >  sendto_one(client_p, "PASS . TS %d %s", TS_CURRENT, me.id);
1987    sendto_one(client_p, "CRYPTLINK SERV %s %s :%s%s",
1988               my_name_for_link(conf), key_to_send,
1989               ConfigServerHide.hidden ? "(H) " : "", me.info);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines