fix for expire not expiring old entries
Richard Todd
rmtodd at skywalker.ecn.ou.edu
Thu Dec 9 04:06:24 UTC 1999
[Foo. Forgot to include the patch. Let's try again.]
When group-based-expire is on, expire never removes history entries
for "old" entries for expired articles (the 2-field entries). This
is because with group-based-expire on, expire never reads expire.ctl.
This patch reenables expire's reading of expire.ctl, and makes it just
ignore the entries in there for per-group expire (since the actual
removal of articles is done by expireover and friends).
Index: expire/expire.c
===================================================================
RCS file: /home/rmtodd/TempCVS/Temp-CVS-Repository/inn-current/expire/expire.c,v
retrieving revision 1.1.1.10
diff -u -r1.1.1.10 expire.c
--- expire.c 1999/11/27 02:07:06 1.1.1.10
+++ expire.c 1999/12/09 02:41:05
@@ -263,10 +263,7 @@
/* Scan all lines. */
EXPremember = -1;
SawDefault = FALSE;
-#if 0
- /* XXX disabled until we find a way to re-enable ng-based expire. */
- patterns = NEW(char*, nGroups);
-#endif
+
for (i = 0; i <= NUM_STORAGE_CLASSES; i++) {
EXPclasses[i].ReportedMissing = FALSE;
EXPclasses[i].Missing = TRUE;
@@ -351,68 +348,12 @@
}
/* Regular expiration line -- right number of fields? */
-#if 0
if (j != 5) {
-#endif
(void)fprintf(stderr, "Line %d bad format\n", i);
return FALSE;
-#if 0
}
-
- /* Parse the fields. */
- if (strchr(fields[1], 'M') != NULL)
- mod = 'm';
- else if (strchr(fields[1], 'U') != NULL)
- mod = 'u';
- else if (strchr(fields[1], 'A') != NULL)
- mod = 'a';
- else {
- (void)fprintf(stderr, "Line %d bad modflag\n", i);
- return FALSE;
- }
- if (!EXPgetnum(i, fields[2], &v.Keep, "keep")
- || !EXPgetnum(i, fields[3], &v.Default, "default")
- || !EXPgetnum(i, fields[4], &v.Purge, "purge"))
- return FALSE;
- /* These were turned into offsets, so the test is the opposite
- * of what you think it should be. If Purge isn't forever,
- * make sure it's greater then the other two fields. */
- if (v.Purge) {
- /* Some value not forever; make sure other values are in range. */
- if (v.Keep && v.Keep < v.Purge) {
- (void)fprintf(stderr, "Line %d keep>purge\n", i);
- return FALSE;
- }
- if (v.Default && v.Default < v.Purge) {
- (void)fprintf(stderr, "Line %d default>purge\n", i);
- return FALSE;
- }
- }
-
- /* Is this the default line? */
- if (fields[0][0] == '*' && fields[0][1] == '\0' && mod == 'a') {
- if (SawDefault) {
- (void)fprintf(stderr, "Line %d duplicate default\n", i);
- return FALSE;
- }
- EXPdefault.Keep = v.Keep;
- EXPdefault.Default = v.Default;
- EXPdefault.Purge = v.Purge;
- SawDefault = TRUE;
- }
-
- /* Assign to all groups that match the pattern and flags. */
- if ((j = EXPsplit(fields[0], ',', patterns, nGroups)) == -1) {
- (void)fprintf(stderr, "Line %d too many patterns\n", i);
- return FALSE;
- }
- for (k = 0; k < j; k++)
- EXPmatch(patterns[k], &v, mod);
-#endif
+ continue; /* don't process this line--per-group expiry is done by expireover */
}
-#if 0
- DISPOSE(patterns);
-#endif
return TRUE;
}
@@ -911,7 +852,7 @@
F = EQ(av[0], "-") ? stdin : EXPfopen(FALSE, av[0], "r", FALSE, FALSE, FALSE);
else
F = EXPfopen(FALSE, cpcatpath(innconf->pathetc, _PATH_EXPIRECTL), "r", FALSE, FALSE, FALSE);
- if (!innconf->groupbaseexpiry && !EXPreadfile(F)) {
+ if (!EXPreadfile(F)) {
(void)fclose(F);
(void)fprintf(stderr, "Format error in expire.ctl\n");
exit(1);
More information about the inn-patches
mailing list