+2000-04-16 Kevin L. Mitchell <klmitch@mit.edu>
+
+ * ircd/gline.c: make gline expire times relative to CurrentTime,
+ since that should be monotonically increasing, instead of
+ TStime(), which can be set backwards, and which can therefore
+ cause an expire time to increase; make local glines be removed
+ instead of just deactivated; don't let gline_find() look for
+ user@host glines if the mask being looked up is a channel mask
+
+ * ircd/send.c (vsendcmdto_one): forgot to account for the case
+ where origin is a server and destination is a user
+
+ * ircd/jupe.c: make jupe expire times relative to CurrentTime,
+ since that should be monotonically increasing, instead of
+ TStime(), which can be set backwards, and which can therefore
+ cause an expire time to increase; make local jupes be removed
+ instead of just deactivated
+
+ * ircd/ircd_snprintf.c: d'oh, thanks for catching that; short for
+ limit is fine. any other warnings I should know about?
+
2000-04-15 Thomas Helvey <tomh@inxpress.net>
* ircd/*.c: const correctness and type safety cleanups to
#
# ChangeLog for ircu2.10.11
#
-# $Id: ChangeLog,v 1.89 2000-04-15 04:20:14 bleep Exp $
+# $Id: ChangeLog,v 1.90 2000-04-16 04:30:42 kev Exp $
#
# Insert new changes at beginning of the change list.
#
GlineIsActive(gline) ? '+' : '-', gline->gl_user,
GlineIsBadChan(gline) ? "" : "@",
GlineIsBadChan(gline) ? "" : gline->gl_host,
- gline->gl_expire - TStime(), gline->gl_lastmod,
+ gline->gl_expire - CurrentTime, gline->gl_lastmod,
gline->gl_reason);
else
sendcmdto_serv_butone(cptr, CMD_GLINE, sptr, "* %c%s%s%s %Tu :%s",
GlineIsActive(gline) ? '+' : '-', gline->gl_user,
GlineIsBadChan(gline) ? "" : "@",
GlineIsBadChan(gline) ? "" : gline->gl_host,
- gline->gl_expire - TStime(), gline->gl_reason);
+ gline->gl_expire - CurrentTime, gline->gl_reason);
}
int
return 0;
}
- expire += TStime(); /* convert from lifetime to timestamp */
+ expire += CurrentTime; /* convert from lifetime to timestamp */
/* NO_OLD_GLINE allows *@#channel to work correctly */
#ifdef BADCHAN
IsServer(sptr) ? sptr->name : sptr->user->server->name,
flags & GLINE_LOCAL ? "local" : "global",
flags & GLINE_BADCHAN ? "BADCHAN" : "GLINE", userhost,
- expire, reason);
+ expire + TSoffset, reason);
#ifdef GPATH
/* and log it */
write_log(GPATH, "# " TIME_T_FMT " %s adding %s %s for %s, expiring at "
TIME_T_FMT ": %s\n", TStime(), sptr->name,
flags & GLINE_LOCAL ? "local" : "global",
- flags & GLINE_BADCHAN ? "BADCHAN" : "GLINE", userhost, expire,
- reason);
+ flags & GLINE_BADCHAN ? "BADCHAN" : "GLINE", userhost,
+ expire + TSoffset, reason);
else
write_log(GPATH, "# " TIME_T_FMT " %s!%s@%s adding %s %s for %s, "
"expiring at " TIME_T_FMT ": %s\n", TStime(), sptr->name,
sptr->user->username, sptr->user->host,
flags & GLINE_LOCAL ? "local" : "global",
- flags & GLINE_BADCHAN ? "BADCHAN" : "GLINE", userhost, expire,
- reason);
+ flags & GLINE_BADCHAN ? "BADCHAN" : "GLINE", userhost,
+ expire + TSoffset, reason);
#endif /* GPATH */
/* make the gline */
time_t lastmod)
{
assert(0 != gline);
+ assert(!GlineIsLocal(gline));
gline->gl_flags |= GLINE_ACTIVE;
- gline->gl_lastmod = lastmod;
+
+ if (gline->gl_lastmod >= lastmod) /* force lastmod to increase */
+ gline->gl_lastmod++;
+ else
+ gline->gl_lastmod = lastmod;
/* Inform ops and log it */
- sendto_op_mask(SNO_GLINE, "%s activating %s %s for %s%s%s, expiring at "
+ sendto_op_mask(SNO_GLINE, "%s activating global %s for %s%s%s, expiring at "
TIME_T_FMT ": %s",
IsServer(sptr) ? sptr->name : sptr->user->server->name,
- GlineIsLocal(gline) ? "local" : "global",
GlineIsBadChan(gline) ? "BADCHAN" : "GLINE",
gline->gl_user, GlineIsBadChan(gline) ? "" : "@",
- GlineIsBadChan(gline) ? "" : gline->gl_host, gline->gl_expire,
- gline->gl_reason);
+ GlineIsBadChan(gline) ? "" : gline->gl_host,
+ gline->gl_expire + TSoffset, gline->gl_reason);
#ifdef GPATH
if (IsServer(sptr))
- write_log(GPATH, "# " TIME_T_FMT " %s activating %s %s for %s%s%s, "
+ write_log(GPATH, "# " TIME_T_FMT " %s activating global %s for %s%s%s, "
"expiring at " TIME_T_FMT ": %s\n", TStime(), sptr->name,
- GlineIsLocal(gline) ? "local" : "global",
GlineIsBadChan(gline) ? "BADCHAN" : "GLINE",
gline->gl_user, GlineIsBadChan(gline) ? "" : "@",
- GlineIsBadChan(gline) ? "" : gline->gl_host, gline->gl_expire,
- gline->gl_reason);
+ GlineIsBadChan(gline) ? "" : gline->gl_host,
+ gline->gl_expire + TSoffset, gline->gl_reason);
else
- write_log(GPATH, "# " TIME_T_FMT " %s!%s@%s activating %s %s for "
+ write_log(GPATH, "# " TIME_T_FMT " %s!%s@%s activating %s for "
"%s%s%s, expiring at " TIME_T_FMT ": %s\n", TStime(), sptr->name,
sptr->user->username, sptr->user->host,
- GlineIsLocal(gline) ? "local" : "global",
GlineIsBadChan(gline) ? "BADCHAN" : "GLINE",
gline->gl_user, GlineIsBadChan(gline) ? "" : "@",
- GlineIsBadChan(gline) ? "" : gline->gl_host, gline->gl_expire,
- gline->gl_reason);
+ GlineIsBadChan(gline) ? "" : gline->gl_host,
+ gline->gl_expire + TSoffset, gline->gl_reason);
#endif /* GPATH */
propagate_gline(cptr, sptr, gline);
{
assert(0 != gline);
- gline->gl_flags &= ~GLINE_ACTIVE;
- gline->gl_lastmod = lastmod;
+ if (!GlineIsLocal(gline)) {
+ gline->gl_flags &= ~GLINE_ACTIVE;
+
+ if (gline->gl_lastmod >= lastmod)
+ gline->gl_lastmod++;
+ else
+ gline->gl_lastmod = lastmod;
+ }
/* Inform ops and log it */
- sendto_op_mask(SNO_GLINE, "%s deactivating %s %s for %s%s%s, expiring at "
+ sendto_op_mask(SNO_GLINE, "%s %s %s for %s%s%s, expiring at "
TIME_T_FMT ": %s",
IsServer(sptr) ? sptr->name : sptr->user->server->name,
- GlineIsLocal(gline) ? "local" : "global",
+ GlineIsLocal(gline) ? "removing local" :
+ "deactivating global",
GlineIsBadChan(gline) ? "BADCHAN" : "GLINE",
gline->gl_user, GlineIsBadChan(gline) ? "" : "@",
- GlineIsBadChan(gline) ? "" : gline->gl_host, gline->gl_expire,
- gline->gl_reason);
+ GlineIsBadChan(gline) ? "" : gline->gl_host,
+ gline->gl_expire + TSoffset, gline->gl_reason);
#ifdef GPATH
if (IsServer(sptr))
- write_log(GPATH, "# " TIME_T_FMT " %s deactivating %s %s for %s%s%s, "
+ write_log(GPATH, "# " TIME_T_FMT " %s %s %s for %s%s%s, "
"expiring at " TIME_T_FMT ": %s\n", TStime(), sptr->name,
- GlineIsLocal(gline) ? "local" : "global",
+ GlineIsLocal(gline) ? "removing local" : "deactivating global",
GlineIsBadChan(gline) ? "BADCHAN" : "GLINE",
gline->gl_user, GlineIsBadChan(gline) ? "" : "@",
- GlineIsBadChan(gline) ? "" : gline->gl_host, gline->gl_expire,
- gline->gl_reason);
+ GlineIsBadChan(gline) ? "" : gline->gl_host,
+ gline->gl_expire + TSoffset, gline->gl_reason);
else
- write_log(GPATH, "# " TIME_T_FMT " %s!%s@%s deactivating %s %s for "
+ write_log(GPATH, "# " TIME_T_FMT " %s!%s@%s %s %s for "
"%s%s%s, expiring at " TIME_T_FMT ": %s\n", TStime(), sptr->name,
sptr->user->username, sptr->user->host,
- GlineIsLocal(gline) ? "local" : "global",
+ GlineIsLocal(gline) ? "removing local" : "deactivating global",
GlineIsBadChan(gline) ? "BADCHAN" : "GLINE",
gline->gl_user, GlineIsBadChan(gline) ? "" : "@",
- GlineIsBadChan(gline) ? "" : gline->gl_host, gline->gl_expire,
- gline->gl_reason);
+ GlineIsBadChan(gline) ? "" : gline->gl_host,
+ gline->gl_expire + TSoffset, gline->gl_reason);
#endif /* GPATH */
- propagate_gline(cptr, sptr, gline);
+ if (GlineIsLocal(gline))
+ gline_free(gline);
+ else
+ propagate_gline(cptr, sptr, gline);
return 0;
}
}
}
- if ((flags & (GLINE_BADCHAN | GLINE_ANY)) == GLINE_BADCHAN)
+ if ((flags & (GLINE_BADCHAN | GLINE_ANY)) == GLINE_BADCHAN ||
+ *userhost == '#' || *userhost == '&' || *userhost == '+'
+#ifndef NO_OLD_GLINE
+ || userhost[2] == '#' || userhost[2] == '&' || userhost[2] == '+'
+#endif /* NO_OLD_GLINE */
+ )
return 0;
DupString(t_uh, userhost);
else if (!GlineIsLocal(gline) && gline->gl_lastmod)
sendcmdto_one(cptr, CMD_GLINE, &me, "* %c%s@%s %Tu %Tu :%s",
GlineIsActive(gline) ? '+' : '-', gline->gl_user,
- gline->gl_host, gline->gl_expire - TStime(),
+ gline->gl_host, gline->gl_expire - CurrentTime,
gline->gl_lastmod, gline->gl_reason);
}
else if (!GlineIsLocal(gline) && gline->gl_lastmod)
sendcmdto_one(cptr, CMD_GLINE, &me, "* %c%s %Tu %Tu :%s",
GlineIsActive(gline) ? '+' : '-', gline->gl_user,
- gline->gl_expire - TStime(), gline->gl_lastmod,
+ gline->gl_expire - CurrentTime, gline->gl_lastmod,
gline->gl_reason);
}
}
GlineIsActive(gline) ? '+' : '-', gline->gl_user,
GlineIsBadChan(gline) ? "" : "@",
GlineIsBadChan(gline) ? "" : gline->gl_host,
- gline->gl_expire - TStime(), gline->gl_lastmod,
+ gline->gl_expire - CurrentTime, gline->gl_lastmod,
gline->gl_reason);
return 0;
/* send gline information along */
sendto_one(sptr, rpl_str(RPL_GLIST), me.name, sptr->name, gline->gl_user,
GlineIsBadChan(gline) ? "" : "@",
- GlineIsBadChan(gline) ? "" : gline->gl_host, gline->gl_expire,
+ GlineIsBadChan(gline) ? "" : gline->gl_host, gline->gl_expire + TSoffset,
GlineIsLocal(gline) ? me.name : "*",
GlineIsActive(gline) ? '+' : '-', gline->gl_reason);
} else {
gline_free(gline);
else
sendto_one(sptr, rpl_str(RPL_GLIST), me.name, sptr->name,
- gline->gl_user, "@", gline->gl_host, gline->gl_expire,
+ gline->gl_user, "@", gline->gl_host, gline->gl_expire + TSoffset,
GlineIsLocal(gline) ? me.name : "*",
GlineIsActive(gline) ? '+' : '-', gline->gl_reason);
}
gline_free(gline);
else
sendto_one(sptr, rpl_str(RPL_GLIST), me.name, sptr->name,
- gline->gl_user, "", "", gline->gl_expire,
+ gline->gl_user, "", "", gline->gl_expire + TSoffset,
GlineIsLocal(gline) ? me.name : "*",
GlineIsActive(gline) ? '+' : '-', gline->gl_reason);
}
gline_free(gline);
else
sendto_one(sptr, rpl_str(RPL_STATSGLINE), me.name, sptr->name, 'G',
- gline->gl_user, gline->gl_host, gline->gl_expire,
+ gline->gl_user, gline->gl_host, gline->gl_expire + TSoffset,
gline->gl_reason);
}
}
size_t buf_size; /* maximum size of buffer */
size_t buf_overflow; /* how much buffer has been overflowed */
size_t buf_loc; /* where we are in the buffer */
- size_t limit; /* max # of chars to convert */
+ short limit; /* max # of chars to convert */
size_t overflow; /* how much we overflowed the limit */
};
buf_s.buf = buf; /* initialize buffer settings */
buf_s.buf_size = buf_len - 1;
- /*
- * XXX - assignment of -1 to size_t
- */
buf_s.limit = -1;
va_start(args, format);
buf_s.buf = buf; /* initialize buffer settings */
buf_s.buf_size = buf_len - 1;
- /*
- * XXX - assignment of -1 to size_t
- */
buf_s.limit = -1;
doprintf(dest, &buf_s, format, args); /* fill the buffer */
#include <assert.h>
-static struct Jupe* GlobalJupeList = 0;
+static struct Jupe *GlobalJupeList = 0;
static struct Jupe *
make_jupe(char *server, char *reason, time_t expire, time_t lastmod,
sendcmdto_serv_butone(cptr, CMD_JUPE, sptr, "* %c%s %Tu %Tu :%s",
JupeIsActive(jupe) ? '+' : '-', jupe->ju_server,
- jupe->ju_expire - TStime(), jupe->ju_lastmod,
+ jupe->ju_expire - CurrentTime, jupe->ju_lastmod,
jupe->ju_reason);
}
return 0;
}
- expire += TStime(); /* convert from lifetime to timestamp */
+ expire += CurrentTime; /* convert from lifetime to timestamp */
/* Inform ops and log it */
- if (IsServer(sptr)) {
sendto_op_mask(SNO_NETWORK, "%s adding %sJUPE for %s, expiring at "
- TIME_T_FMT ": %s", sptr->name, local ? "local " : "",
- server, expire, reason);
+ TIME_T_FMT ": %s",
+ IsServer(sptr) ? sptr->name : sptr->user->server->name,
+ local ? "local " : "", server, expire + TSoffset, reason);
+
#ifdef JPATH
+ if (IsServer(sptr))
write_log(JPATH, TIME_T_FMT " %s adding %sJUPE for %s, expiring at "
TIME_T_FMT ": %s\n", TStime(), sptr->name,
- local ? "local " : "", server, expire, reason);
-#endif /* JPATH */
- } else {
- sendto_op_mask(SNO_NETWORK, "%s adding %sJUPE for %s, expiring at "
- TIME_T_FMT ": %s", sptr->user->server->name,
- local ? "local " : "", server, expire,
- reason);
-#ifdef JPATH
+ local ? "local " : "", server, expire + TSoffset, reason);
+ else
write_log(JPATH, TIME_T_FMT, " %s!%s@%s adding %sJUPE for %s, expiring at "
TIME_T_FMT ": %s\n", TStime(), sptr->name, sptr->user->username,
- sptr->user->host, local ? "local " : "", server, expire, reason);
+ sptr->user->host, local ? "local " : "", server,
+ expire + TSoffset, reason);
#endif /* JPATH */
- }
if (active) /* compute initial flags */
flags |= JUPE_ACTIVE;
time_t lastmod)
{
assert(0 != jupe);
+ assert(!JupeIsLocal(jupe));
jupe->ju_flags |= JUPE_ACTIVE;
- jupe->ju_lastmod = lastmod;
+
+ if (jupe->ju_lastmod >= lastmod) /* force lastmod to increase */
+ jupe->ju_lastmod++;
+ else
+ jupe->ju_lastmod = lastmod;
/* Inform ops and log it */
- if (IsServer(sptr)) {
- sendto_op_mask(SNO_NETWORK, "%s activating %sJUPE for %s, expiring at "
- TIME_T_FMT ": %s", sptr->name, JupeIsLocal(jupe) ?
- "local " : "", jupe->ju_server, jupe->ju_expire,
- jupe->ju_reason);
-#ifdef JPATH
- write_log(JPATH, TIME_T_FMT " %s activating %sJUPE for %s, expiring at "
- TIME_T_FMT ": %s\n", TStime(), sptr->name, JupeIsLocal(jupe) ?
- "local " : "", jupe->ju_server, jupe->ju_expire,
- jupe->ju_reason);
-#endif /* JPATH */
- } else {
- sendto_op_mask(SNO_NETWORK, "%s activating %sJUPE for %s, expiring at "
- TIME_T_FMT ": %s", sptr->user->server->name,
- JupeIsLocal(jupe) ? "local " : "", jupe->ju_server,
- jupe->ju_expire, jupe->ju_reason);
+ sendto_op_mask(SNO_NETWORK, "%s activating JUPE for %s, expiring at "
+ TIME_T_FMT ": %s",
+ IsServer(sptr) ? sptr->name : sptr->user->server->name,
+ jupe->ju_server, jupe->ju_expire + TSoffset, jupe->ju_reason);
+
#ifdef JPATH
- write_log(JPATH, TIME_T_FMT, " %s!%s@%s activating %sJUPE for %s, "
+ if (IsServer(sptr))
+ write_log(JPATH, TIME_T_FMT " %s activating JUPE for %s, expiring at "
+ TIME_T_FMT ": %s\n", TStime(), sptr->name, jupe->ju_server,
+ jupe->ju_expire + TSoffset, jupe->ju_reason);
+ else
+ write_log(JPATH, TIME_T_FMT, " %s!%s@%s activating JUPE for %s, "
"expiring at " TIME_T_FMT ": %s\n", TStime(), sptr->name,
- sptr->user->username, sptr->user->host, JupeIsLocal(jupe) ?
- "local " : "", jupe->ju_server, jupe->ju_expire,
- jupe->ju_reason);
+ sptr->user->username, sptr->user->host, jupe->ju_server,
+ jupe->ju_expire + TSoffset, jupe->ju_reason);
#endif /* JPATH */
- }
propagate_jupe(cptr, sptr, jupe);
{
assert(0 != jupe);
- jupe->ju_flags &= ~JUPE_ACTIVE;
- jupe->ju_lastmod = lastmod;
+ if (!JupeIsLocal(jupe)) {
+ jupe->ju_flags &= ~JUPE_ACTIVE;
+
+ if (jupe->ju_lastmod >= lastmod) /* force lastmod to increase */
+ jupe->ju_lastmod++;
+ else
+ jupe->ju_lastmod = lastmod;
+ }
/* Inform ops and log it */
- if (IsServer(sptr)) {
- sendto_op_mask(SNO_NETWORK, "%s deactivating %sJUPE for %s, expiring at "
- TIME_T_FMT ": %s", sptr->name, JupeIsLocal(jupe) ?
- "local " : "", jupe->ju_server, jupe->ju_expire,
- jupe->ju_reason);
-#ifdef JPATH
- write_log(JPATH, TIME_T_FMT " %s deactivating %sJUPE for %s, expiring at "
- TIME_T_FMT ": %s\n", TStime(), sptr->name, JupeIsLocal(jupe) ?
- "local " : "", jupe->ju_server, jupe->ju_expire,
- jupe->ju_reason);
-#endif /* JPATH */
- } else {
- sendto_op_mask(SNO_NETWORK, "%s deactivating %sJUPE for %s, expiring at "
- TIME_T_FMT ": %s", sptr->user->server->name,
- JupeIsLocal(jupe) ? "local " : "", jupe->ju_server,
- jupe->ju_expire, jupe->ju_reason);
+ sendto_op_mask(SNO_NETWORK, "%s %s JUPE for %s, expiring at " TIME_T_FMT
+ ": %s",
+ IsServer(sptr) ? sptr->name : sptr->user->server->name,
+ JupeIsLocal(jupe) ? "removing local" : "deactivating",
+ jupe->ju_server, jupe->ju_expire + TSoffset, jupe->ju_reason);
+
#ifdef JPATH
- write_log(JPATH, TIME_T_FMT, " %s!%s@%s deactivating %sJUPE for %s, "
+ if (IsServer(sptr))
+ write_log(JPATH, TIME_T_FMT " %s %s JUPE for %s, expiring at " TIME_T_FMT
+ ": %s\n", TStime(), sptr->name,
+ JupeIsLocal(jupe) ? "removing local" : "deactivating",
+ jupe->ju_server, jupe->ju_expire + TSoffset, jupe->ju_reason);
+ else
+ write_log(JPATH, TIME_T_FMT, " %s!%s@%s %s JUPE for %s, "
"expiring at " TIME_T_FMT ": %s\n", TStime(), sptr->name,
- sptr->user->username, sptr->user->host, JupeIsLocal(jupe) ?
- "local " : "", jupe->ju_server, jupe->ju_expire,
- jupe->ju_reason);
+ sptr->user->username, sptr->user->host,
+ JupeIsLocal(jupe) ? "removing local" : "deactivating",
+ jupe->ju_server, jupe->ju_expire + TSoffset, jupe->ju_reason);
#endif /* JPATH */
- }
- propagate_jupe(cptr, sptr, jupe);
+ if (JupeIsLocal(jupe))
+ jupe_free(jupe);
+ else
+ propagate_jupe(cptr, sptr, jupe);
return 0;
}
for (jupe = GlobalJupeList; jupe; jupe = sjupe) { /* go through jupes */
sjupe = jupe->ju_next;
- if (jupe->ju_expire <= TStime()) /* expire any that need expiring */
+ if (jupe->ju_expire <= CurrentTime) /* expire any that need expiring */
jupe_free(jupe);
else if (0 == ircd_strcmp(server, jupe->ju_server)) /* found it yet? */
return jupe;
for (jupe = GlobalJupeList; jupe; jupe = sjupe) { /* go through jupes */
sjupe = jupe->ju_next;
- if (jupe->ju_expire <= TStime()) /* expire any that need expiring */
+ if (jupe->ju_expire <= CurrentTime) /* expire any that need expiring */
jupe_free(jupe);
else if (!JupeIsLocal(jupe)) /* forward global jupes */
sendcmdto_one(cptr, CMD_JUPE, &me, "* %c%s %Tu %Tu :%s",
JupeIsActive(jupe) ? '+' : '-', jupe->ju_server,
- jupe->ju_expire - TStime(), jupe->ju_lastmod,
+ jupe->ju_expire - CurrentTime, jupe->ju_lastmod,
jupe->ju_reason);
}
}
sendcmdto_one(cptr, CMD_JUPE, &me, "* %c%s %Tu %Tu :%s",
JupeIsActive(jupe) ? '+' : '-', jupe->ju_server,
- jupe->ju_expire - TStime(), jupe->ju_lastmod, jupe->ju_reason);
+ jupe->ju_expire - CurrentTime, jupe->ju_lastmod,
+ jupe->ju_reason);
return 0;
}
/* send jupe information along */
sendto_one(sptr, rpl_str(RPL_JUPELIST), me.name, sptr->name,
- jupe->ju_server, jupe->ju_expire, JupeIsLocal(jupe) ?
- me.name : "*", JupeIsActive(jupe) ? '+' : '-', jupe->ju_reason);
+ jupe->ju_server, jupe->ju_expire + TSoffset,
+ JupeIsLocal(jupe) ? me.name : "*",
+ JupeIsActive(jupe) ? '+' : '-', jupe->ju_reason);
} else {
for (jupe = GlobalJupeList; jupe; jupe = sjupe) { /* go through jupes */
sjupe = jupe->ju_next;
- if (jupe->ju_expire <= TStime()) /* expire any that need expiring */
+ if (jupe->ju_expire <= CurrentTime) /* expire any that need expiring */
jupe_free(jupe);
else /* send jupe information along */
sendto_one(sptr, rpl_str(RPL_JUPELIST), me.name, sptr->name,
- jupe->ju_server, jupe->ju_expire, JupeIsLocal(jupe) ?
- me.name : "*", JupeIsActive(jupe) ? '+' : '-',
- jupe->ju_reason);
+ jupe->ju_server, jupe->ju_expire + TSoffset,
+ JupeIsLocal(jupe) ? me.name : "*",
+ JupeIsActive(jupe) ? '+' : '-', jupe->ju_reason);
}
}
vd.vd_format = pattern; /* set up the struct VarData for %v */
vd.vd_args = vl;
- if (MyUser(to)) /* :nick!user@host form; use cmd */
- ircd_snprintf(to, sndbuf, sizeof(sndbuf) - 2, ":%s!%s@%s %s %v",
- from->name, from->user->username, from->user->host,
- cmd, &vd);
- else /* numeric form; use tok */
+ if (MyUser(to)) { /* :nick!user@host form; use cmd */
+ if (IsServer(from) || IsMe(from))
+ ircd_snprintf(to, sndbuf, sizeof(sndbuf) - 2, ":%s %s %v",
+ from->name, cmd, &vd);
+ else
+ ircd_snprintf(to, sndbuf, sizeof(sndbuf) - 2, ":%s!%s@%s %s %v",
+ from->name, from->user->username, from->user->host,
+ cmd, &vd);
+ } else /* numeric form; use tok */
ircd_snprintf(to, sndbuf, sizeof(sndbuf) - 2, "%C %s %v", from, tok, &vd);
send_buffer(to, sndbuf);