X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=ircd%2Fm_gline.c;h=9b6f66164fdcca12c755de0aeec95aac6fbb523c;hb=refs%2Fheads%2Fupstream;hp=d379c611076d2ba675a3769cf57baec00d924587;hpb=b41bd506a1da169102d71d8170e753b94377b82c;p=ircu2.10.12-pk.git diff --git a/ircd/m_gline.c b/ircd/m_gline.c index d379c61..9b6f661 100644 --- a/ircd/m_gline.c +++ b/ircd/m_gline.c @@ -113,7 +113,7 @@ * but you can't have everything in a macro ;) */ #define abs_expire(exp) \ - ((exp) >= CurrentTime - PASTWATCH ? (exp) : (exp) + CurrentTime) + ((exp) >= TStime() - PASTWATCH ? (exp) : (exp) + TStime()) /* * ms_gline - server message handler @@ -167,6 +167,10 @@ ms_gline(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) break; } + /* Is there no mask left? */ + if (mask[0] == '\0') + return need_more_params(sptr, "GLINE"); + /* Now, let's figure out if it's a local or global G-line */ if (action == GLINE_LOCAL_ACTIVATE || action == GLINE_LOCAL_DEACTIVATE || (target[0] == '*' && target[1] == '\0')) @@ -258,13 +262,13 @@ ms_gline(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) "target %s, mask %s, operforce %s, action %c, expire %Tu, " "lastmod %Tu, reason: %s", target, mask, flags & GLINE_OPERFORCE ? "YES" : "NO", - action == GLINE_ACTIVATE ? '+' : '-', expire, CurrentTime, + action == GLINE_ACTIVATE ? '+' : '-', expire, TStime(), reason)); sendcmdto_one(sptr, CMD_GLINE, acptr, "%C %s%c%s %Tu %Tu :%s", acptr, flags & GLINE_OPERFORCE ? "!" : "", action == GLINE_ACTIVATE ? '+' : '-', mask, - expire - CurrentTime, CurrentTime, reason); + expire - TStime(), TStime(), reason); return 0; /* all done */ } @@ -308,7 +312,7 @@ ms_gline(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) if (!agline || /* gline creation, has to be the reason */ /* trial-convert as lifetime, and if it doesn't fully convert, * it must be the reason */ - ((lifetime = strtoul(parv[5], &tmp, 10)) && !*tmp)) { + (!(lifetime = strtoul(parv[5], &tmp, 10)) && !*tmp)) { lifetime = 0; reason = parv[5]; @@ -423,7 +427,7 @@ mo_gline(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) return need_more_params(sptr, "GLINE"); target = parv[2]; /* get the target... */ - expire = strtol(parv[3], &end, 10) + CurrentTime; /* and the expiration */ + expire = strtol(parv[3], &end, 10) + TStime(); /* and the expiration */ if (*end != '\0') return send_reply(sptr, SND_EXPLICIT | ERR_BADEXPIRE, "%s :Bad expire time", parv[3]); @@ -460,7 +464,7 @@ mo_gline(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) if (parc > 3) { /* get expiration and target */ reason = parv[parc - 1]; - expire = strtol(parv[parc - 2], &end, 10) + CurrentTime; + expire = strtol(parv[parc - 2], &end, 10) + TStime(); if (*end != '\0') return send_reply(sptr, SND_EXPLICIT | ERR_BADEXPIRE, "%s :Bad expire time", parv[parc - 2]); @@ -477,6 +481,10 @@ mo_gline(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) break; } + /* Is there no mask left? */ + if (mask[0] == '\0') + return need_more_params(sptr, "GLINE"); + /* Now let's figure out which is the target server */ if (!target) /* no target, has to be me... */ acptr = &me; @@ -554,7 +562,7 @@ mo_gline(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) sendcmdto_one(sptr, CMD_GLINE, acptr, "%C %s%c%s %Tu %Tu :%s", acptr, flags & GLINE_OPERFORCE ? "!" : "", action == GLINE_ACTIVATE ? '+' : '-', mask, - expire - CurrentTime, CurrentTime, reason); + expire - TStime(), TStime(), reason); return 0; /* all done */ } @@ -624,14 +632,14 @@ mo_gline(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) if (agline) /* modifying an existing G-line */ return gline_modify(cptr, sptr, agline, action, reason, expire, - CurrentTime, 0, flags); + TStime(), 0, flags); assert(action != GLINE_LOCAL_ACTIVATE); assert(action != GLINE_LOCAL_DEACTIVATE); assert(action != GLINE_MODIFY); /* create a new G-line */ - return gline_add(cptr, sptr, mask, reason, expire, CurrentTime, 0, + return gline_add(cptr, sptr, mask, reason, expire, TStime(), 0, flags | ((action == GLINE_ACTIVATE) ? GLINE_ACTIVE : 0)); }