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

Comparing ircd-hybrid/trunk/src/s_user.c (file contents):
Revision 2134 by michael, Wed May 29 18:59:39 2013 UTC vs.
Revision 2145 by michael, Thu May 30 10:57:08 2013 UTC

# Line 135 | Line 135 | const unsigned int user_modes[256] =
135    UMODE_UNAUTH,       /* u */
136    0,                  /* v */
137    UMODE_WALLOP,       /* w */
138 <  0,                  /* x */
138 >  UMODE_HIDDENHOST,   /* x */
139    UMODE_SPY,          /* y */
140    UMODE_OPERWALL,     /* z      0x7A */
141    0,0,0,0,0,          /* 0x7B - 0x7F */
# Line 903 | Line 903 | set_user_mode(struct Client *client_p, s
903            break;
904  
905          case 'r':  /* Only services may set +r */
906 +        case 'x':  /* Only services may set +x */
907            break;
908  
909          default:
# Line 1052 | Line 1053 | send_umode_out(struct Client *client_p,
1053   }
1054  
1055   void
1056 < user_set_hostmask(struct Client *target_p, const char *hostname)
1056 > user_set_hostmask(struct Client *target_p, const char *hostname, const int what)
1057   {
1058 <  if (!valid_hostname(hostname))
1058 >  dlink_node *ptr = NULL;
1059 >
1060 >  if (!strcmp(target_p->host, hostname))
1061      return;
1062  
1063 +  switch (what)
1064 +  {
1065 +    case MODE_ADD:
1066 +      AddUMode(target_p, UMODE_HIDDENHOST);
1067 +      AddFlag(target_p, FLAGS_IP_SPOOFING);
1068 +      break;
1069 +    case MODE_DEL:
1070 +      DelUMode(target_p, UMODE_HIDDENHOST);
1071 +
1072 +      if (!HasFlag(target_p, FLAGS_AUTH_SPOOF))
1073 +        DelFlag(target_p, FLAGS_IP_SPOOFING);
1074 +      break;
1075 +    default: return;
1076 +  }
1077 +
1078 +  sendto_common_channels_local(target_p, 0, 0, ":%s!%s@%s QUIT :Changing hostname",
1079 +                               target_p->name, target_p->username, target_p->host);
1080 +
1081    if (IsUserHostIp(target_p))
1082      delete_user_host(target_p->username, target_p->host, !MyConnect(target_p));
1083  
1084    strlcpy(target_p->host, hostname, sizeof(target_p->host));
1064  SetIPSpoof(target_p);
1085  
1086    add_user_host(target_p->username, target_p->host, !MyConnect(target_p));
1087    SetUserHost(target_p);
1088  
1089    if (MyClient(target_p))
1090 +  {
1091 +    sendto_one(target_p, form_str(RPL_NEWHOSTIS), me.name,
1092 +               target_p->name, target_p->host);
1093      clear_ban_cache_client(target_p);
1094 +  }
1095 +
1096 +  DLINK_FOREACH(ptr, target_p->channel.head)
1097 +  {
1098 +    char modebuf[4], nickbuf[NICKLEN * 3 + 3] = { '\0' };
1099 +    char *p = modebuf;
1100 +    int len = 0;
1101 +    const struct Membership *ms = ptr->data;
1102 +
1103 +    if (has_member_flags(ms, CHFL_CHANOP)) {
1104 +      *p++ = 'o';
1105 +      len += snprintf(nickbuf + len, sizeof(nickbuf) - len, len ? " %s" : "%s", target_p->name);
1106 +    }
1107 +
1108 +    if (has_member_flags(ms, CHFL_HALFOP)) {
1109 +      *p++ = 'h';
1110 +      len += snprintf(nickbuf + len, sizeof(nickbuf) - len, len ? " %s" : "%s", target_p->name);
1111 +    }
1112 +
1113 +    if (has_member_flags(ms, CHFL_VOICE)) {
1114 +      *p++ = 'v';
1115 +      len += snprintf(nickbuf + len, sizeof(nickbuf) - len, len ? " %s" : "%s", target_p->name);
1116 +    }
1117 +
1118 +    *p = '\0';
1119 +
1120 +    sendto_channel_local_butone(target_p, 0, 0, ms->chptr, ":%s!%s@%s JOIN :%s",
1121 +                                target_p->name, target_p->username, target_p->host,
1122 +                                ms->chptr->chname);
1123 +    if (nickbuf[0])
1124 +      sendto_channel_local_butone(target_p, 0, 0, ms->chptr, ":%s MODE %s +%s %s",
1125 +                                  target_p->servptr->name, ms->chptr->chname,
1126 +                                  modebuf, nickbuf);
1127 +
1128 +  }
1129 +
1130 +  if (target_p->away[0])
1131 +    sendto_common_channels_local(target_p, 0, CAP_AWAY_NOTIFY,
1132 +                                 ":%s!%s@%s AWAY :%s",
1133 +                                 target_p->name, target_p->username,
1134 +                                 target_p->host, target_p->away);
1135   }
1136  
1137   /* user_welcome()

Diff Legend

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