documentation wrong for groupbaseexpire

Dan Merillat harik at chaos.ao.net
Fri Jan 21 00:27:35 UTC 2000


Katsuhiro Kondou writes:
> In article <200001202033.PAA15085 at chaos.ao.net>,
> 	Dan Merillat <harik at chaos.ao.net> wrote;
> 
> } Delayrm is also optional, so the expire process should work without it.
> 
> Aha, I see.  Attached would fix and I've comitted.

Actually, the logic makes more sense if we check unlink file for null then attempt to open
inside the check for delayrm block.  Something like this: (compiles, havn't really thrashed
it out yet)

--- storage/ov.c	2000/01/14 03:44:23	1.9
+++ storage/ov.c	2000/01/21 00:25:12
@@ -362,10 +362,18 @@
 	    (void)fprintf(stderr, "OVGROUPBASEDEXPIRE is not allowed if groupbaseexpiry if false");
 	    return FALSE;
 	}
-	if (((OVGE *)val)->delayrm && ((((OVGE *)val)->filename == NULL) || strlen(((OVGE *)val)->filename) == 0)) {
-	    syslog(L_ERROR, "file name must be specified");
-	    (void)fprintf(stderr, "file name must be specified");
-	    return FALSE;
+	if (((OVGE *)val)->delayrm) {
+	    if ((((OVGE *)val)->filename == NULL) || (strlen(((OVGE *)val)->filename) == 0)) {
+		syslog(L_ERROR, "file name must be specified");
+		(void)fprintf(stderr, "file name must be specified");
+	  	return FALSE;
+	    }
+	    if ((EXPunlinkfile = fopen(((OVGE *)val)->filename, "w")) == NULL) {
+		syslog(L_ERROR, "fopen: %s failed: %m", ((OVGE *)val)->filename);
+		(void)fprintf(stderr, "fopen: %s failed: %s", ((OVGE *)val)->filename, 
+			      strerror(errno));
+		return FALSE;
+	    }
 	}
 	OVdelayrm = ((OVGE *)val)->delayrm;
 	OVusepost = ((OVGE *)val)->usepost;
@@ -375,11 +383,6 @@
 	OVkeep = ((OVGE *)val)->keep;
 	OVearliest = ((OVGE *)val)->earliest;
 	OVignoreselfexpire = ((OVGE *)val)->ignoreselfexpire;
-	if ((EXPunlinkfile = fopen(((OVGE *)val)->filename, "w")) == NULL) {
-	    syslog(L_ERROR, "fopen: %s failed: %m", ((OVGE *)val)->filename);
-	    (void)fprintf(stderr, "fopen: %s failed: %s", ((OVGE *)val)->filename, strerror(errno));
-	    return FALSE;
-	}
 	return TRUE;
     }
     return ((*ov.ctl)(type, val));


--Dan



More information about the inn-workers mailing list