gline->gl_host ? "@" : "",
gline->gl_host ? gline->gl_host : "",
gline->gl_expire - CurrentTime, gline->gl_lastmod,
- gline->gl_lifetime - CurrentTime, gline->gl_reason);
+ gline->gl_lifetime, gline->gl_reason);
return 0;
}
* @param[in] sptr Client that originated the G-line.
* @param[in] userhost Text mask for the G-line.
* @param[in] reason Reason for G-line.
- * @param[in] expire Duration of G-line in seconds.
+ * @param[in] expire Expiration time of G-line.
* @param[in] lastmod Last modification time of G-line.
* @param[in] lifetime Lifetime of G-line.
* @param[in] flags Bitwise combination of GLINE_* flags.
* You cannot set a negative (or zero) expire time, nor can you set an
* expiration time for greater than GLINE_MAX_EXPIRE.
*/
- if (!(flags & GLINE_FORCE) && (expire <= 0 || expire > GLINE_MAX_EXPIRE)) {
+ if (!(flags & GLINE_FORCE) &&
+ (expire <= CurrentTime || expire > CurrentTime + GLINE_MAX_EXPIRE)) {
if (!IsServer(sptr) && MyConnect(sptr))
send_reply(sptr, ERR_BADEXPIRE, expire);
return 0;
}
- expire += CurrentTime; /* convert from lifetime to timestamp */
-
if (!lifetime) /* no lifetime set, use expiration time */
lifetime = expire;
- else /* convert lifetime into timestamp */
- lifetime += CurrentTime;
+
+ /* lifetime is already an absolute timestamp */
/* Inform ops... */
sendto_opmask_butone(0, ircd_strncmp(reason, "AUTO", 4) ? SNO_GLINE :
* @param[in] gline G-line being modified.
* @param[in] action Resultant status of the G-line.
* @param[in] reason Reason for G-line.
- * @param[in] expire Duration of G-line in seconds.
+ * @param[in] expire Expiration time of G-line.
* @param[in] lastmod Last modification time of G-line.
* @param[in] lifetime Lifetime of G-line.
* @param[in] flags Bitwise combination of GLINE_* flags.
/* All right, we know that there's a change of some sort. What is it? */
/* first, check out the expiration time... */
if ((flags & GLINE_EXPIRE) && expire) {
- if (!(flags & GLINE_FORCE) && (expire <= 0 || expire > GLINE_MAX_EXPIRE)) {
+ if (!(flags & GLINE_FORCE) &&
+ (expire <= CurrentTime || expire > CurrentTime + GLINE_MAX_EXPIRE)) {
if (!IsServer(sptr) && MyConnect(sptr)) /* bad expiration time */
send_reply(sptr, ERR_BADEXPIRE, expire);
return 0;
}
-
- /* convert to a timestamp... */
- expire += CurrentTime;
} else
flags &= ~GLINE_EXPIRE;
}
/* Next, check out lifetime--this one's a bit trickier... */
- if ((flags & GLINE_LIFETIME) && lifetime)
- lifetime += CurrentTime; /* convert to a timestamp */
- else
+ if (!(flags & GLINE_LIFETIME) || !lifetime)
lifetime = gline->gl_lifetime; /* use G-line lifetime */
lifetime = IRCD_MAX(lifetime, expire); /* set lifetime to the max */
gline->gl_user, gline->gl_host ? "@" : "",
gline->gl_host ? gline->gl_host : "",
gline->gl_expire - CurrentTime, gline->gl_lastmod,
- gline->gl_lifetime - CurrentTime, gline->gl_reason);
+ gline->gl_lifetime, gline->gl_reason);
/* OK, let's do the G-line... */
return do_gline(cptr, sptr, gline);
gline->gl_host ? "@" : "",
gline->gl_host ? gline->gl_host : "",
gline->gl_expire - CurrentTime, gline->gl_lastmod,
- gline->gl_lifetime - CurrentTime, gline->gl_reason);
+ gline->gl_lifetime, gline->gl_reason);
}
gliter(BadChanGlineList, gline, sgline) {
sendcmdto_one(&me, CMD_GLINE, cptr, "* %c%s %Tu %Tu %Tu :%s",
GlineIsRemActive(gline) ? '+' : '-', gline->gl_user,
gline->gl_expire - CurrentTime, gline->gl_lastmod,
- gline->gl_lifetime - CurrentTime, gline->gl_reason);
+ gline->gl_lifetime, gline->gl_reason);
}
}
gline->gl_host ? "@" : "",
gline->gl_host ? gline->gl_host : "",
gline->gl_expire - CurrentTime, gline->gl_lastmod,
- gline->gl_lifetime - CurrentTime, gline->gl_reason);
+ gline->gl_lifetime, gline->gl_reason);
return 0;
}