diff --git a/Changes b/Changes index 6e147266b..881de947f 100644 --- a/Changes +++ b/Changes @@ -7,6 +7,8 @@ Anope Version S V N 09/25 F Fixed menu not properly removed after uninstall on windows. [#944] 09/27 F Fixed a buffer overflow in enc_sha1. [#947] 09/30 F Fixed error in OPER help. [#943] +09/30 F Fixed OS IGNORE behaviour. [#941] +09/30 F Fixed error in the SASET help. [#950] Provided by Robin Burchell - 2008 09/22 F Enabled UMODE functionality for InspIRCd 1.1 [ #00] diff --git a/lang/cat.l b/lang/cat.l index e0e6a375c..2cdc50c11 100644 --- a/lang/cat.l +++ b/lang/cat.l @@ -3862,7 +3862,7 @@ NICK_HELP_SASET_DISPLAY Limited to Services admins. NICK_HELP_SASET_PASSWORD - Syntax: SET nickname PASSWORD new-password + Syntax: SASET nickname PASSWORD new-password Changes the password used to identify as the nick's owner. diff --git a/lang/de.l b/lang/de.l index 3c84edcff..0cf7931d8 100644 --- a/lang/de.l +++ b/lang/de.l @@ -3864,7 +3864,7 @@ NICK_HELP_SASET_DISPLAY entsprechenden Gruppe sein. NICK_HELP_SASET_PASSWORD - Syntax: SET nickname PASSWORD new-password + Syntax: SASET nickname PASSWORD new-password Ändert das Passwort um sich als Besitzer eines Nicknamens zu identifizieren. diff --git a/lang/en_us.l b/lang/en_us.l index 01c347dc2..f1ad63638 100644 --- a/lang/en_us.l +++ b/lang/en_us.l @@ -3720,7 +3720,7 @@ NICK_HELP_SASET_DISPLAY Services. The new display MUST be a nick of the group. NICK_HELP_SASET_PASSWORD - Syntax: SET nickname PASSWORD new-password + Syntax: SASET nickname PASSWORD new-password Changes the password used to identify as the nick's owner. diff --git a/lang/es.l b/lang/es.l index 0b43fdc56..c4b57c44a 100644 --- a/lang/es.l +++ b/lang/es.l @@ -3836,7 +3836,7 @@ NICK_HELP_SASET_DISPLAY Limited to Services admins. NICK_HELP_SASET_PASSWORD - Syntax: SET nickname PASSWORD new-password + Syntax: SASET nickname PASSWORD new-password Changes the password used to identify as the nick's owner. diff --git a/lang/gr.l b/lang/gr.l index d3a7d070b..651db9590 100644 --- a/lang/gr.l +++ b/lang/gr.l @@ -3864,7 +3864,7 @@ NICK_HELP_SASET_DISPLAY Limited to Services admins. NICK_HELP_SASET_PASSWORD - Syntax: SET nickname PASSWORD new-password + Syntax: SASET nickname PASSWORD new-password Changes the password used to identify as the nick's owner. diff --git a/lang/hun.l b/lang/hun.l index d1022bccb..baa9ccb04 100644 --- a/lang/hun.l +++ b/lang/hun.l @@ -3782,7 +3782,7 @@ NICK_HELP_SASET_DISPLAY Limited to Services admins. NICK_HELP_SASET_PASSWORD - Syntax: SET nickname PASSWORD new-password + Syntax: SASET nickname PASSWORD new-password Changes the password used to identify as the nick's owner. diff --git a/lang/it.l b/lang/it.l index cd261eb52..366c0d715 100644 --- a/lang/it.l +++ b/lang/it.l @@ -3748,7 +3748,7 @@ NICK_HELP_SASET_DISPLAY Limitato ai Services admins. NICK_HELP_SASET_PASSWORD - Sintassi: SET nickname PASSWORD nuova-password + Sintassi: SASET nickname PASSWORD nuova-password Cambia la password utilizzata per identificarsi come proprietario del nick. diff --git a/lang/nl.l b/lang/nl.l index 99a6e9428..540a05414 100644 --- a/lang/nl.l +++ b/lang/nl.l @@ -3811,7 +3811,7 @@ NICK_HELP_SASET_DISPLAY Services. The new display MUST be a nick of the group. NICK_HELP_SASET_PASSWORD - Syntax: SET nickname PASSWORD new-password + Syntax: SASET nickname PASSWORD new-password Changes the password used to identify as the nick's owner. diff --git a/lang/pl.l b/lang/pl.l index 150eb63f8..3c94eb5f2 100644 --- a/lang/pl.l +++ b/lang/pl.l @@ -4038,7 +4038,7 @@ NICK_HELP_SASET_DISPLAY Limited to Services admins. NICK_HELP_SASET_PASSWORD - Syntax: SET nickname PASSWORD new-password + Syntax: SASET nickname PASSWORD new-password Changes the password used to identify as the nick's owner. diff --git a/lang/pt.l b/lang/pt.l index bb953c49e..7e9be3127 100644 --- a/lang/pt.l +++ b/lang/pt.l @@ -3764,7 +3764,7 @@ NICK_HELP_SASET_DISPLAY Limited to Services admins. NICK_HELP_SASET_PASSWORD - Syntax: SET nickname PASSWORD new-password + Syntax: SASET nickname PASSWORD new-password Changes the password used to identify as the nick's owner. diff --git a/lang/tr.l b/lang/tr.l index e544bcd93..51e897b3a 100644 --- a/lang/tr.l +++ b/lang/tr.l @@ -3857,7 +3857,7 @@ NICK_HELP_SASET_DISPLAY Limited to Services admins. NICK_HELP_SASET_PASSWORD - Syntax: SET nickname PASSWORD new-password + Syntax: SASET nickname PASSWORD new-password Changes the password used to identify as the nick's owner. diff --git a/src/core/os_ignore.c b/src/core/os_ignore.c index ffac6b036..b6d47764a 100644 --- a/src/core/os_ignore.c +++ b/src/core/os_ignore.c @@ -95,7 +95,6 @@ int do_ignoreuser(User * u) notice_lang(s_OperServ, u, OPER_IGNORE_VALID_TIME); return MOD_CONT; } else if (t == 0) { - t = 157248000; /* if 0 is given, we set time to 157248000 seconds == 5 years (let's hope the next restart will be before that time ;-)) */ add_ignore(nick, t); notice_lang(s_OperServ, u, OPER_IGNORE_PERM_DONE, nick); } else { diff --git a/src/messages.c b/src/messages.c index db81fdc80..6b119bd8f 100644 --- a/src/messages.c +++ b/src/messages.c @@ -136,7 +136,7 @@ int m_privmsg(const char *source, const char *receiver, const char *msg) /* Check if we should ignore. Operators always get through. */ if (allow_ignore && !is_oper(u)) { IgnoreData *ign = get_ignore(source); - if (ign && ign->time > time(NULL)) { + if (ign) { alog("Ignored message from %s: \"%s\"", source, inbuf); return MOD_CONT; } diff --git a/src/process.c b/src/process.c index 8cb4f14bc..552bb93b8 100644 --- a/src/process.c +++ b/src/process.c @@ -27,38 +27,46 @@ IgnoreData *ignore; /*************************************************************************/ /** - * Add a mask/nick to the ignorelits for delta seconds. - * @param nick Nick or (nick!)user@host to add to the ignorelist. - * @param delta Seconds untill new entry is set to expire. + * Add a mask/nick to the ignorelits for delta seconds. + * @param nick Nick or (nick!)user@host to add to the ignorelist. + * @param delta Seconds untill new entry is set to expire. 0 for permanent. */ void add_ignore(const char *nick, time_t delta) { IgnoreData *ign; char tmp[BUFSIZE]; char *mask, *user, *host; - time_t now = time(NULL); - if (!nick) + User *u; + time_t now; + if (!nick) return; - - /* Determine whether we get a nick or a mask. */ - if ((host = strchr(nick, '@'))) { - /* Check whether we have a nick too.. */ + now = time(NULL); + + /* If it s an existing user, we ignore the hostmask. */ + if ((u = finduser(nick))) { + snprintf(tmp, sizeof(tmp), "*!*@%s", u->host); + mask = sstrdup(tmp); + + /* Determine whether we get a nick or a mask. */ + } else if ((host = strchr(nick, '@'))) { + /* Check whether we have a nick too.. */ if ((user = strchr(nick, '!'))) { - /* this should never happen */ + /* this should never happen */ if (user > host) return; mask = sstrdup(nick); } else { - /* We have user@host. Add nick wildcard. */ + /* We have user@host. Add nick wildcard. */ snprintf(tmp, sizeof(tmp), "*!%s", nick); mask = sstrdup(tmp); } + + /* We only got a nick.. */ } else { - /* We only got a nick.. */ - snprintf(tmp, sizeof(tmp), "%s!*@*", nick); + snprintf(tmp, sizeof(tmp), "%s!*@*", nick); mask = sstrdup(tmp); } - + /* Check if we already got an identical entry. */ for (ign = ignore; ign; ign = ign->next) if (stricmp(ign->mask, mask) == 0) @@ -66,13 +74,15 @@ void add_ignore(const char *nick, time_t delta) /* Found one.. */ if (ign) { - if (ign->time < now + delta) + if (delta == 0) + ign->time = 0; + else if (ign->time < now + delta) ign->time = now + delta; /* Create new entry.. */ } else { ign = (IgnoreData *)scalloc(sizeof(*ign), 1); ign->mask = mask; - ign->time = now + delta; + ign->time = (delta == 0 ? 0 : now + delta); ign->prev = NULL; ign->next = ignore; if (ignore) @@ -87,9 +97,9 @@ void add_ignore(const char *nick, time_t delta) /** * Retrieve an ignorance record for a nick or mask. - * If the nick isn't being ignored, we return NULL and if necesary - * flush the record from the in-core list (i.e. ignore timed out). - * @param nick Nick or (nick!)user@host to look for on the ignorelist. + * If the nick isn't being ignored, we return NULL and if necesary + * flush the record from the ignore list (i.e. ignore timed out). + * @param nick Nick or (nick!)user@host to look for on the ignorelist. * @return Pointer to the ignore record, NULL if none was found. */ IgnoreData *get_ignore(const char *nick) @@ -97,49 +107,53 @@ IgnoreData *get_ignore(const char *nick) IgnoreData *ign; char tmp[BUFSIZE]; char *user, *host; - time_t now = time(NULL); - User *u = finduser(nick); - if (!nick) + time_t now; + User *u; + if (!nick) return NULL; - /* User has disabled the IGNORE system */ + + /* User has disabled the IGNORE system */ if (!allow_ignore) return NULL; - /* If we found a real user, match his mask against the ignorelist. */ + now = time(NULL); + u = finduser(nick); + + /* If we find a real user, match his mask against the ignorelist. */ if (u) { - /* Opers are not ignored, even if a matching entry may be present. */ + /* Opers are not ignored, even if a matching entry may be present. */ if (is_oper(u)) return NULL; for (ign = ignore; ign; ign = ign->next) if (match_usermask(ign->mask, u)) break; - } else { - /* We didn't get a user.. generate a valid mask. */ + } else { + /* We didn't get a user.. generate a valid mask. */ if ((host = strchr(nick, '@'))) { if ((user = strchr(nick, '!'))) { - /* this should never happen */ + /* this should never happen */ if (user > host) return NULL; snprintf(tmp, sizeof(tmp), "%s", nick); } else { - /* We have user@host. Add nick wildcard. */ + /* We have user@host. Add nick wildcard. */ snprintf(tmp, sizeof(tmp), "*!%s", nick); } - } else { - /* We only got a nick.. */ - snprintf(tmp, sizeof(tmp), "%s!*@*", nick); - } - for (ign = ignore; ign; ign = ign->next) + + /* We only got a nick.. */ + } else + snprintf(tmp, sizeof(tmp), "%s!*@*", nick); + for (ign = ignore; ign; ign = ign->next) if (match_wild_nocase(ign->mask, tmp)) break; } - - /* Check whether the entry has timed out */ - if (ign && ign->time <= now) { + + /* Check whether the entry has timed out */ + if (ign && ign->time != 0 && ign->time <= now) { if (debug) alog("debug: Expiring ignore entry %s", ign->mask); if (ign->prev) ign->prev->next = ign->next; - else if (ignore == ign) + else if (ignore == ign) ignore = ign->next; if (ign->next) ign->next->prev = ign->prev; @@ -147,7 +161,7 @@ IgnoreData *get_ignore(const char *nick) free(ign); ign = NULL; } - if (ign && debug) + if (ign && debug) alog("debug: Found ignore entry (%s) for %s", ign->mask, nick); return ign; } @@ -162,67 +176,71 @@ IgnoreData *get_ignore(const char *nick) */ int delete_ignore(const char *nick) { - IgnoreData * ign; + IgnoreData *ign; char tmp[BUFSIZE]; char *user, *host; - if (!nick) + User *u; + if (!nick) return 0; - - /* Determine whether we get a nick or a mask. */ - if ((host = strchr(nick, '@'))) { - /* Check whether we have a nick too.. */ + + /* If it s an existing user, we ignore the hostmask. */ + if ((u = finduser(nick))) { + snprintf(tmp, sizeof(tmp), "*!*@%s", u->host); + + /* Determine whether we get a nick or a mask. */ + } else if ((host = strchr(nick, '@'))) { + /* Check whether we have a nick too.. */ if ((user = strchr(nick, '!'))) { - /* this should never happen */ + /* this should never happen */ if (user > host) return 0; snprintf(tmp, sizeof(tmp), "%s", nick); } else { - /* We have user@host. Add nick wildcard. */ + /* We have user@host. Add nick wildcard. */ snprintf(tmp, sizeof(tmp), "*!%s", nick); } - } else { - /* We only got a nick.. */ - snprintf(tmp, sizeof(tmp), "%s!*@*", nick); - } + + /* We only got a nick.. */ + } else + snprintf(tmp, sizeof(tmp), "%s!*@*", nick); + for (ign = ignore; ign; ign = ign->next) if (stricmp(ign->mask, tmp) == 0) break; - - /* No matching ignore found. */ + + /* No matching ignore found. */ if (!ign) return 0; - if (debug) + if (debug) alog("Deleting ignore entry %s", ign->mask); - - /* Delete the entry and all references to it. */ + + /* Delete the entry and all references to it. */ if (ign->prev) ign->prev->next = ign->next; - else if (ignore == ign) + else if (ignore == ign) ignore = ign->next; if (ign->next) ign->next->prev = ign->prev; - free(ign->mask); + free(ign->mask); free(ign); ign = NULL; - return 1; + return 1; + } -} - - - -/*************************************************************************/ - -/** - * Clear the ignorelist. - * @return The number of entries deleted. - */ -int clear_ignores() + +/*************************************************************************/ + +/** + * Clear the ignorelist. + * @return The number of entries deleted. + */ +int clear_ignores() { - IgnoreData * ign, *next; + IgnoreData *ign, *next; int i = 0; - if (!ignore) + if (!ignore) return 0; - for (ign = ignore; ign; ign = next) { + for (ign = ignore; ign; ign = next) { next = ign->next; if (debug) alog("Deleting ignore entry %s", ign->mask); @@ -230,10 +248,9 @@ int clear_ignores() free(ign); i++; } - ignore = NULL; + ignore = NULL; return i; - -} + } /*************************************************************************/ diff --git a/version.log b/version.log index d6250bfb6..24fe5c49a 100644 --- a/version.log +++ b/version.log @@ -9,10 +9,22 @@ VERSION_MAJOR="1" VERSION_MINOR="7" VERSION_PATCH="22" VERSION_EXTRA="-svn" -VERSION_BUILD="1455" +VERSION_BUILD="1458" # $Log$ # +# BUILD : 1.7.22 (1458) +# BUGS : 950 +# NOTES : Fixed an error in the help docs on SASET. Patch provided by chaz. +# +# BUILD : 1.7.22 (1457) +# BUGS : +# NOTES : Forgot Changes log. Autoformatters during commit ought to die.. last try to get process.c properly formatted in SVN. +# +# BUILD : 1.7.22 (1456) +# BUGS : 948 +# NOTES : We now support real permanent ignoring. When ignoring a nick we now also use the hostmask if the user exists. +# # BUILD : 1.7.22 (1455) # BUGS : 943 # NOTES : Applied patch by katsklaw to fix a bug in HELP OPER.