+2005-05-02 Michael Poole <mdpoole@troilus.org>
+
+ * include/numeric.h (ERR_UPASS_SAME_APASS): New error message when
+ trying to set +U pass to the same as the +A pass.
+
+ * ircd/channel.c (mode_parse_upass): Use it.
+
+ * ircd/ircd_auth.c (iauth_exit_client): Only send ExitUser if
+ there is an active IAuth connection, fixing PR#1193808.
+ (iauth_dispose_request): Only delete the timer if it is active.
+
+ * ircd/m_invite.c (m_invite): Always forward the invite in the
+ correct direction, and then skip it as 'one' if announcing.
+ (ms_invite): Likewise.
+
+ * ircd/numnicks.c (base64toip): Do not interpret AAAAAA as
+ ::ffff:0.0.0.0; keep it as ::.
+
+ * ircd/s_err.c (replyTable): Add ERR_UPASS_SAME_APASS.
+
2005-05-01 Michael Poole <mdpoole@troilus.org>
* doc/readme.log: Document IAUTH log target, remove docs for
#define ERR_UPASSNOTSET 554 /* Undernet extension */
#define ERR_NOMANAGER_LONG 555 /* Undernet extension */
#define ERR_NOMANAGER_SHORT 556 /* Undernet extension */
-#define ERR_LASTERROR 557
+#define ERR_UPASS_SAME_APASS 557 /* Undernet extension */
+#define ERR_LASTERROR 558
/* RPL_LOGON 600 dalnet,unreal
RPL_LOGOFF 601 dalnet,unreal
send_reply(state->sptr, ERR_UPASSNOTSET, state->chptr->chname, state->chptr->chname);
return;
}
+ /* cannot set a +U password that is the same as +A */
+ if (state->dir == MODE_ADD && !ircd_strcmp(state->chptr->mode.apass, t_str)) {
+ send_reply(state->sptr, ERR_UPASS_SAME_APASS, state->chptr->chname);
+ return;
+ }
/* can't add a upass if one is set, nor can one remove the wrong upass */
if ((state->dir == MODE_ADD && *state->chptr->mode.upass) ||
(state->dir == MODE_DEL &&
iauth_dispose_request(iauth_active, cli_iauth(cptr));
cli_iauth(cptr) = NULL;
}
- if (!i_GetConnected(iauth_active))
- return;
- iauth_send(iauth_active, "ExitUser %x", cptr);
- iauth_write(iauth_active);
+ if (iauth_active && i_GetConnected(iauth_active)) {
+ iauth_send(iauth_active, "ExitUser %x", cptr);
+ iauth_write(iauth_active);
+ }
}
/** Find pending request with a particular ID.
static void iauth_dispose_request(struct IAuth *iauth, struct IAuthRequest *iar)
{
assert(iar->iar_client != NULL);
- if (iar->iar_timed)
+ if (iar->iar_timed && t_active(&i_request_timer(iauth)))
timer_del(&i_request_timer(iauth));
cli_iauth(iar->iar_client) = NULL;
iar->iar_prev->iar_next = iar->iar_next;
if (MyConnect(acptr)) {
add_invite(acptr, chptr);
sendcmdto_one(sptr, CMD_INVITE, acptr, "%s %H", cli_name(acptr), chptr);
+ } else {
+ sendcmdto_one(sptr, CMD_INVITE, acptr, "%s %H %Tu", cli_name(acptr), chptr,
+ chptr->creationtime);
}
if (!IsLocalChannel(chptr->chname) || MyConnect(acptr)) {
"%H %C %C :%C has been invited by %C",
chptr, acptr, sptr, acptr, sptr);
/* Announce to servers with channel operators. */
- sendcmdto_channel_servers_butone(sptr, NULL, TOK_INVITE, chptr, NULL, SKIP_NONOPS,
+ sendcmdto_channel_servers_butone(sptr, NULL, TOK_INVITE, chptr, acptr, SKIP_NONOPS,
"%s %H %Tu", cli_name(acptr),
chptr, chptr->creationtime);
}
return 0;
if (MyConnect(acptr)) {
- add_invite(acptr, chptr);
- sendcmdto_one(sptr, CMD_INVITE, acptr, "%s %H", cli_name(acptr), chptr);
+ add_invite(acptr, chptr);
+ sendcmdto_one(sptr, CMD_INVITE, acptr, "%s %H", cli_name(acptr), chptr);
+ } else {
+ sendcmdto_one(sptr, CMD_INVITE, acptr, "%s %H %Tu", cli_name(acptr), chptr,
+ chptr->creationtime);
}
if (feature_bool(FEAT_ANNOUNCE_INVITES)) {
"%H %C %C :%C has been invited by %C",
chptr, acptr, sptr, acptr, sptr);
/* Announce to servers with channel operators. */
- sendcmdto_channel_servers_butone(sptr, NULL, TOK_INVITE, chptr, NULL, SKIP_NONOPS,
+ sendcmdto_channel_servers_butone(sptr, NULL, TOK_INVITE, chptr, acptr, SKIP_NONOPS,
"%s %H %Tu", cli_name(acptr), chptr,
chptr->creationtime);
}
return 0;
}
-
-
memset(addr, 0, sizeof(*addr));
if (strlen(input) == 6) {
unsigned int in = base64toint(input);
- addr->in6_16[5] = htons(65535);
- addr->in6_16[6] = htons(in >> 16);
- addr->in6_16[7] = htons(in & 65535);
+ /* An all-zero address should stay that way. */
+ if (in) {
+ addr->in6_16[5] = htons(65535);
+ addr->in6_16[6] = htons(in >> 16);
+ addr->in6_16[7] = htons(in & 65535);
+ }
} else {
unsigned int pos = 0;
do {
/* 556 */
{ ERR_NOMANAGER_SHORT, "%s :Re-create the channel. The channel must be *empty* for a minute or two before it can be recreated.", "556" },
/* 557 */
- { 0 },
+ { ERR_UPASS_SAME_APASS, "%s :Cannot use the same pass for both admin (+A) and user (+U) pass.", "557" },
/* 558 */
{ 0 },
/* 559 */