From: Gunnar Beutner Date: Sun, 14 Jul 2013 11:24:55 +0000 (+0200) Subject: glstore: Don't save gline flags. X-Git-Url: https://jfr.im/git/irc/quakenet/newserv.git/commitdiff_plain/0d9e9fabb101ee9c83d2244ca0fe20cf04d4bebc glstore: Don't save gline flags. --HG-- branch : shroudtrusts --- diff --git a/glines/glines_store.c b/glines/glines_store.c index fb7446f1..cfb7c20d 100644 --- a/glines/glines_store.c +++ b/glines/glines_store.c @@ -16,7 +16,7 @@ static int glstore_savefile(const char *file) { for (gl = glinelist; gl; gl = gl->next) { fprintf(fp, "%s %jd,%jd,%jd,%d,%s,%s\n", glinetostring(gl), (intmax_t)gl->expire, (intmax_t)gl->lastmod, (intmax_t)gl->lifetime, - gl->flags & ~(GLINE_HOSTMASK | GLINE_IPMASK | GLINE_BADCHAN | GLINE_REALNAME), + (gl->flags & GLINE_ACTIVE) ? 1 : 0, gl->creator->content, gl->reason->content); count++; } @@ -30,7 +30,7 @@ static int glstore_loadfile(const char *file) { FILE *fp; char mask[512], creator[512], reason[512]; intmax_t expire, lastmod, lifetime; - int flags, count; + int active, count; gline *gl; fp = fopen(file, "r"); @@ -41,7 +41,7 @@ static int glstore_loadfile(const char *file) { count = 0; while (!feof(fp)) { - if (fscanf(fp, "%[^ ]%jd,%jd,%jd,%d,%[^,],%[^\n]\n", mask, &expire, &lastmod, &lifetime, &flags, creator, reason) != 7) + if (fscanf(fp, "%[^ ]%jd,%jd,%jd,%d,%[^,],%[^\n]\n", mask, &expire, &lastmod, &lifetime, &active, creator, reason) != 7) continue; count++; @@ -58,7 +58,7 @@ static int glstore_loadfile(const char *file) { gl->creator = getsstring(creator, 512); - gl->flags |= flags; + gl->flags = active ? GLINE_ACTIVE : 0; gl->reason = getsstring(reason, 512); gl->expire = expire;