fix possible crash on user deletion
[srvx.git] / src / gline.h
index 2824bdebd4dbd5790cb9706de85bb79e07672966..65f17a216d41cc59ba0978df2dc5153e04abae7e 100644 (file)
 #include "hash.h"
 
 struct gline {
-    time_t issued;
-    time_t expires;
+    /** When the G-line was first created. */
+    unsigned long issued;
+    /** When the G-line was last modified. */
+    unsigned long lastmod;
+    /** When the G-line becomes ineffective. */
+    unsigned long expires;
+    /** When the G-line may be forgotten (the maximum "expires" value
+     * from any modification period).
+     */
+    unsigned long lifetime;
+    /** Account or nick name of the person creating the G-line. */
     char *issuer;
+    /** user@host mask covered by the G-line. */
     char *target;
+    /** What to tell affected users. */
     char *reason;
 };
 
@@ -38,12 +49,16 @@ struct gline_discrim {
     char *target_mask;
     char *alt_target_mask;
     char *reason_mask;
-    time_t max_issued;
-    time_t min_expire;
+    unsigned long max_issued;
+    unsigned long min_expire;
+    unsigned long min_lastmod;
+    unsigned long max_lastmod;
+    unsigned long min_lifetime;
+    unsigned long max_lifetime;
 };
 
 void gline_init(void);
-struct gline *gline_add(const char *issuer, const char *target, unsigned long duration, const char *reason, time_t issued, int announce);
+struct gline *gline_add(const char *issuer, const char *target, unsigned long duration, const char *reason, unsigned long issued, unsigned long lastmod, unsigned long lifetime, int announce);
 struct gline *gline_find(const char *target);
 int gline_remove(const char *target, int announce);
 void gline_refresh_server(struct server *srv);