+2004-12-17 Michael Poole <mdpoole@troilus.org>
+
+ * ircd/channel.c (sub1_from_channel): Immediately destroy
+ non-Apass channels when oplevels are enabled; otherwise, they can
+ stay opless for a considerable period.
+ (mode_parse_ban): Initialize banstr to NULL so that set_ban_mask()
+ does not try to free() an invalid pointer.
+
+ * ircd/ircd_parser.y (uworldblock): Put UWorld server name into
+ aconf->host, not aconf->name.
+
+ * ircd/m_server.c (mr_server, ms_server): Attach CONF_UWORLD items
+ by host here..
+
+ * ircd/s_conf.c (conf_check_server): .. rather than by name here.
+ (attach_conf_uworld): New function to attach CONF_UWORLD items.
+ (rehash): Use attach_conf_uworld() instead of attaching by name.
+
2004-12-15 Michael Poole <mdpoole@troilus.org>
* ircd/m_topic.c (do_settopic): Allow +k services to set topics on
* who then will educate them on the use of Apass/upass.
*/
- if (feature_bool(FEAT_OPLEVELS)) {
- if (TStime() - chptr->creationtime < 172800) /* Channel younger than 48 hours? */
+ if (!(chptr->mode.mode & MODE_APASS)) /* If no Apass, destroy now. */
+ destruct_channel(chptr);
+ else if (TStime() - chptr->creationtime < 172800) /* Channel younger than 48 hours? */
schedule_destruct_event_1m(chptr); /* Get rid of it in approximately 4-5 minutes */
else
schedule_destruct_event_48h(chptr); /* Get rid of it in approximately 48 hours */
- } else
- destruct_channel(chptr);
return 0;
}
newban->next = 0;
newban->flags = ((state->dir == MODE_ADD) ? BAN_ADD : BAN_DEL)
| (*flag_p == 'b' ? 0 : BAN_EXCEPTION);
+ newban->banstr = NULL;
set_ban_mask(newban, collapse(pretty_mask(t_str)));
newban->who = cli_name(state->sptr);
newban->when = TStime();
if (name)
{
struct ConfItem *aconf = make_conf(CONF_UWORLD);
- aconf->name = name;
+ aconf->host = name;
}
else
{
cli_serv(cptr)->ghost = ghost;
SetServerYXX(cptr, cptr, parv[6]);
+ /* Attach any necessary UWorld config items. */
+ attach_confs_byhost(cptr, host, CONF_UWORLD);
+
if (*parv[7] == '+') {
for (ch = parv[7] + 1; *ch; ch++)
switch (*ch) {
for numeric nicks ! */
SetServerYXX(cptr, acptr, parv[6]);
+ /* Attach any necessary UWorld config items. */
+ attach_confs_byhost(cptr, host, CONF_UWORLD);
+
if (*parv[7] == '+') {
for (ch = parv[7] + 1; *ch; ch++)
switch (*ch) {
conf_error = 1;
}
+/** Attach CONF_UWORLD items to a server and everything attached to it. */
+static void
+attach_conf_uworld(struct Client *cptr)
+{
+ struct DLink *lp;
+
+ attach_confs_byhost(cptr, cli_name(cptr), CONF_UWORLD);
+ for (lp = cli_serv(cptr)->down; lp; lp = lp->next)
+ attach_conf_uworld(lp->value.cptr);
+}
+
/** Reload the configuration file.
* @param cptr Client that requested rehash (if a signal, &me).
* @param sig Type of rehash (0 = oper-requested, 1 = signal, 2 =
for (i = 0; i <= HighestFd; i++) {
if ((acptr = LocalClientArray[i])) {
assert(!IsMe(acptr));
- if (IsServer(acptr)) {
+ if (IsServer(acptr))
det_confs_butmask(acptr, ~(CONF_UWORLD | CONF_ILLEGAL));
- attach_confs_byname(acptr, cli_name(acptr), CONF_UWORLD);
- }
/* Because admin's are getting so uppity about people managing to
* get past K/G's etc, we'll "fix" the bug by actually explaining
* whats going on.
}
}
+ attach_conf_uworld(&me);
+
return ret;
}
* attach the Connect block to the client structure for later use.
*/
attach_conf(cptr, c_conf);
- attach_confs_byname(cptr, cli_name(cptr), CONF_UWORLD);
if (!irc_in_addr_valid(&c_conf->address.addr))
memcpy(&c_conf->address.addr, &cli_ip(cptr), sizeof(c_conf->address.addr));