1
0
mirror of https://github.com/anope/anope.git synced 2026-07-07 01:43:13 +02:00

Merge commit 'trunk' into anopeng

Conflicts:

	src/process.c


git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1279 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
Robin Burchell w00t@inspircd.org
2008-09-30 21:54:22 +00:00
parent 0464e2eb14
commit f70f57219f
16 changed files with 120 additions and 90 deletions
+2
View File
@@ -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 <w00t@inspircd.org> - 2008
09/22 F Enabled UMODE functionality for InspIRCd 1.1 [ #00]
+1 -1
View File
@@ -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.
+1 -1
View File
@@ -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.
+1 -1
View File
@@ -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.
+1 -1
View File
@@ -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.
+1 -1
View File
@@ -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.
+1 -1
View File
@@ -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.
+1 -1
View File
@@ -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.
+1 -1
View File
@@ -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.
+1 -1
View File
@@ -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.
+1 -1
View File
@@ -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.
+1 -1
View File
@@ -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.
-1
View File
@@ -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 {
+1 -1
View File
@@ -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;
}
+93 -76
View File
@@ -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)
/* Determine whether we get a nick or a mask. */
if ((host = strchr(nick, '@'))) {
/* Check whether we have a nick too.. */
return;
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, '@'))) {
/* this should never happen */
/* Check whether we have a nick too.. */
if ((user = strchr(nick, '!'))) {
/* this should never happen */
if (user > host)
return;
/* We have user@host. Add nick wildcard. */
mask = sstrdup(nick);
} else {
/* We have user@host. Add nick wildcard. */
snprintf(tmp, sizeof(tmp), "*!%s", nick);
mask = sstrdup(tmp);
}
/* We only got a nick.. */
snprintf(tmp, sizeof(tmp), "%s!*@*", nick);
/* We only got a nick.. */
} else {
snprintf(tmp, sizeof(tmp), "%s!*@*", nick);
mask = sstrdup(tmp);
}
@@ -66,13 +74,15 @@ void add_ignore(const char *nick, time_t delta)
for (ign = ignore; ign; ign = ign->next)
if (stricmp(ign->mask, mask) == 0)
break;
if (ign->time < now + delta)
/* Found one.. */
if (ign) {
if (delta == 0)
ign->time = 0;
else if (ign->time < now + delta)
ign->time = now + delta;
/* Create new entry.. */
ign->time = now + delta;
} else {
ign = (IgnoreData *)scalloc(sizeof(*ign), 1);
ign->mask = mask;
ign->time = (delta == 0 ? 0 : now + delta);
@@ -87,9 +97,9 @@ void add_ignore(const char *nick, time_t delta)
}
/*************************************************************************/
* 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.
/**
* 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 ignore list (i.e. ignore timed out).
* @param nick Nick or (nick!)user@host to look for on the ignorelist.
@@ -97,49 +107,53 @@ IgnoreData *get_ignore(const char *nick)
*/
IgnoreData *get_ignore(const char *nick)
{
time_t now = time(NULL);
User *u = finduser(nick);
if (!nick)
IgnoreData *ign;
char tmp[BUFSIZE];
char *user, *host;
time_t now;
/* User has disabled the IGNORE system */
User *u;
if (!nick)
return NULL;
/* If we found a real user, match his mask against the ignorelist. */
/* User has disabled the IGNORE system */
if (!allow_ignore)
return NULL;
/* Opers are not ignored, even if a matching entry may be present. */
now = time(NULL);
u = finduser(nick);
} else {
/* We didn't get a user.. generate a valid mask. */
/* 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. */
if (is_oper(u))
/* this should never happen */
return NULL;
for (ign = ignore; ign; ign = ign->next)
if (match_usermask(ign->mask, u))
break;
/* We have user@host. Add nick wildcard. */
} else {
/* We didn't get a user.. generate a valid mask. */
if ((host = strchr(nick, '@'))) {
} else {
/* We only got a nick.. */
snprintf(tmp, sizeof(tmp), "%s!*@*", nick);
}
for (ign = ignore; ign; ign = ign->next)
if ((user = strchr(nick, '!'))) {
/* this should never happen */
if (user > host)
return NULL;
snprintf(tmp, sizeof(tmp), "%s", nick);
} else {
/* We have user@host. Add nick wildcard. */
snprintf(tmp, sizeof(tmp), "*!%s", nick);
/* Check whether the entry has timed out */
if (ign && ign->time <= now) {
}
/* We only got a nick.. */
} else
snprintf(tmp, sizeof(tmp), "%s!*@*", nick);
else if (ignore == ign)
for (ign = ignore; ign; ign = ign->next)
if (match_wild_nocase(ign->mask, tmp))
break;
}
@@ -147,7 +161,7 @@ IgnoreData *get_ignore(const char *nick)
/* Check whether the entry has timed out */
if (ign && ign->time != 0 && ign->time <= now) {
if (debug)
if (ign && debug)
alog("debug: Expiring ignore entry %s", ign->mask);
if (ign->prev)
ign->prev->next = ign->next;
else if (ignore == ign)
@@ -162,67 +176,71 @@ IgnoreData *get_ignore(const char *nick)
if (ign && debug)
alog("debug: Found ignore entry (%s) for %s", ign->mask, nick);
return ign;
IgnoreData * ign;
}
if (!nick)
/*************************************************************************/
/**
/* Determine whether we get a nick or a mask. */
if ((host = strchr(nick, '@'))) {
/* Check whether we have a nick too.. */
* Deletes a given nick/mask from the ignorelist.
* @param nick Nick or (nick!)user@host to delete from the ignorelist.
* @return Returns 1 on success, 0 if no entry is found.
*/
int delete_ignore(const char *nick)
{
IgnoreData *ign;
char tmp[BUFSIZE];
char *user, *host;
/* this should never happen */
User *u;
if (!nick)
return 0;
/* We have user@host. Add nick wildcard. */
/* If it s an existing user, we ignore the hostmask. */
if ((u = finduser(nick))) {
snprintf(tmp, sizeof(tmp), "*!*@%s", u->host);
} else {
/* We only got a nick.. */
snprintf(tmp, sizeof(tmp), "%s!*@*", nick);
}
/* 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 */
if (user > host)
return 0;
/* No matching ignore found. */
snprintf(tmp, sizeof(tmp), "%s", nick);
} else {
/* We have user@host. Add nick wildcard. */
snprintf(tmp, sizeof(tmp), "*!%s", nick);
if (debug)
}
/* Delete the entry and all references to it. */
/* We only got a nick.. */
} else
snprintf(tmp, sizeof(tmp), "%s!*@*", nick);
else if (ignore == ign)
for (ign = ignore; ign; ign = ign->next)
if (stricmp(ign->mask, tmp) == 0)
break;
free(ign->mask);
/* No matching ignore found. */
if (!ign)
return 1;
return 0;
if (debug)
}
/*************************************************************************/
/**
* Clear the ignorelist.
* @return The number of entries deleted.
*/
int clear_ignores()
alog("Deleting ignore entry %s", ign->mask);
/* Delete the entry and all references to it. */
if (ign->prev)
ign->prev->next = ign->next;
else if (ignore == ign)
ignore = ign->next;
if (ign->next)
ign->next->prev = ign->prev;
IgnoreData * ign, *next;
if (!ignore)
free(ign->mask);
free(ign);
for (ign = ignore; ign; ign = next) {
ign = NULL;
return 1;
@@ -230,10 +248,9 @@ int clear_ignores()
ignore = NULL;
/*************************************************************************/
}
/**
* Clear the ignorelist.
* @return The number of entries deleted.
*/
+13 -1
View File
@@ -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.