summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2011-08-23 19:29:59 -0400
committerAdam <Adam@anope.org>2011-08-23 19:29:59 -0400
commitfa833766a0bf2f263e4d0bdd105cb7b4a89ebf07 (patch)
tree35ace256be371f1dc09186ad29648d8e97efb0f2
parent783f77d367b6117658e87898db4b5c31e7299a4a (diff)
Made os_sxline and os_akill use a stored value to curent time to prevent the off-chance of time changing while executing the function which can mess up our globops/log messages
-rw-r--r--src/core/os_akill.c4
-rw-r--r--src/core/os_sgline.c6
-rw-r--r--src/core/os_sqline.c4
-rw-r--r--src/core/os_szline.c4
-rw-r--r--version.log3
5 files changed, 11 insertions, 10 deletions
diff --git a/src/core/os_akill.c b/src/core/os_akill.c
index 2a91b8e6b..b49a449db 100644
--- a/src/core/os_akill.c
+++ b/src/core/os_akill.c
@@ -85,7 +85,7 @@ int do_akill(User * u)
if (!stricmp(cmd, "ADD")) {
int deleted = 0;
char *expiry, *mask, *reason;
- time_t expires;
+ time_t expires, now = time(NULL);
mask = strtok(NULL, " ");
if (mask && *mask == '+') {
@@ -155,7 +155,7 @@ int do_akill(User * u)
if (!expires) {
strcpy(buf, "does not expire");
} else {
- int wall_expiry = expires - time(NULL);
+ int wall_expiry = expires - now;
char *s = NULL;
if (wall_expiry >= 86400) {
diff --git a/src/core/os_sgline.c b/src/core/os_sgline.c
index 4cf508e35..cf9e90893 100644
--- a/src/core/os_sgline.c
+++ b/src/core/os_sgline.c
@@ -85,7 +85,7 @@ int do_sgline(User * u)
if (!stricmp(cmd, "ADD")) {
int deleted = 0;
char *expiry, *mask, *reason;
- time_t expires;
+ time_t expires, now = time(NULL);
mask = strtok(NULL, ":");
if (mask && *mask == '+') {
@@ -110,7 +110,7 @@ int do_sgline(User * u)
notice_lang(s_OperServ, u, BAD_EXPIRY_TIME);
return MOD_CONT;
} else if (expires > 0) {
- expires += time(NULL);
+ expires += now;
}
if (mask && (reason = strtok(NULL, ""))) {
@@ -142,7 +142,7 @@ int do_sgline(User * u)
if (!expires) {
strcpy(buf, "does not expire");
} else {
- int wall_expiry = expires - time(NULL);
+ int wall_expiry = expires - now;
char *s = NULL;
if (wall_expiry >= 86400) {
diff --git a/src/core/os_sqline.c b/src/core/os_sqline.c
index 199b7d6e4..f21b1c6bd 100644
--- a/src/core/os_sqline.c
+++ b/src/core/os_sqline.c
@@ -84,7 +84,7 @@ int do_sqline(User * u)
if (!stricmp(cmd, "ADD")) {
int deleted = 0;
char *expiry, *mask, *reason;
- time_t expires;
+ time_t expires, now = time(NULL);
mask = strtok(NULL, " ");
if (mask && *mask == '+') {
@@ -137,7 +137,7 @@ int do_sqline(User * u)
if (!expires) {
strcpy(buf, "does not expire");
} else {
- int wall_expiry = expires - time(NULL);
+ int wall_expiry = expires - now;
char *s = NULL;
if (wall_expiry >= 86400) {
diff --git a/src/core/os_szline.c b/src/core/os_szline.c
index 14250b14d..ec0e7acfd 100644
--- a/src/core/os_szline.c
+++ b/src/core/os_szline.c
@@ -83,7 +83,7 @@ int do_szline(User * u)
if (!stricmp(cmd, "ADD")) {
int deleted = 0;
char *expiry, *mask, *reason;
- time_t expires;
+ time_t expires, now = time(NULL);
mask = strtok(NULL, " ");
if (mask && *mask == '+') {
@@ -134,7 +134,7 @@ int do_szline(User * u)
if (!expires) {
strcpy(buf, "does not expire");
} else {
- int wall_expiry = expires - time(NULL);
+ int wall_expiry = expires - now;
char *s = NULL;
if (wall_expiry >= 86400) {
diff --git a/version.log b/version.log
index 9e65a93a3..3d9416cd6 100644
--- a/version.log
+++ b/version.log
@@ -8,9 +8,10 @@ VERSION_MAJOR="1"
VERSION_MINOR="8"
VERSION_PATCH="7"
VERSION_EXTRA="-git"
-VERSION_BUILD="3081"
+VERSION_BUILD="3082"
# $Log$ # Changes since 1.8.6 Release
+#Revision 3082 - Made os_sxline and os_akill use a stored value to curent time to prevent the off-chance of time changing while executing the function which can mess up our globops/log messages
#Revision 3081 - Added event to warn modules a nickcore gets a new display nick or is about to be dropped. (This should enable modules to more easily link their data to anopes core data.)
#Revision 3080 - Send DROP event when forbidding nicks and channels, if applicable.
#Revision 3079 - Bug #1318 - #1320 - Added support for Hybrid's +S and +O channel modes, and removed support for +a