mirror of
https://github.com/anope/anope.git
synced 2026-07-03 05:33:13 +02:00
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
This commit is contained in:
+2
-2
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user