Article View: news.software.nntp
Article #11114Re: inn1.4u4 BUG (was Re: Expire pauses but never unpauses)
From: James Brister
Date: Tue, 24 Sep 1996 00:00
Date: Tue, 24 Sep 1996 00:00
110 lines
4103 bytes
4103 bytes
sawyerk@apci.net (Kevin Sawyer) writes:
> I'm back, and I looked through the source. BUG! Check out expire.c in the
> inn1.4unoff4 distribution. You'll find this:
>
> HistoryText = _PATH_HISTORY;
> HistoryPath = NULL;
>
> I'm no rocket scientist, but I think it should be this:
>
> HistoryPath = _PATH_HISTORY;
> HistoryText = NULL;
>
> Anyway, I made that modification, recompiled, ran news.daily, and VIOLA!
> Everything works just like it is supposed to! (For now anyway...)
>
> Please tell me if I just screwed myself. ;-)
I think you did... The (poorly named) variable HistoryPath really means the
directory the history file is in, not the path of the history file itself,
whereas _PATH_HISTORY *is* the path of the history file. I'm surprised it
doesn't core dump, unless you're passing in a '-h' and a '-d'
flag. Appended here is a patch that *should* work against unoff4's
expire.c.
James
--
James Brister brister@vix.com
Internet Software Consortium inn@isc.org
---------------------------------------------------------------------------
*** expire.c 1996/07/08 20:35:33 1.20
--- expire.c 1996/07/09 15:25:19 1.21
***************
*** 70,76 ****
STATIC BOOL EXPsizing;
STATIC BOOL EXPtracing;
STATIC BOOL EXPusepost;
- STATIC char EXPnewslib[] = _PATH_NEWSLIB;
STATIC char ACTIVE[] = _PATH_ACTIVE;
STATIC char SPOOL[] = _PATH_SPOOL;
STATIC int nGroups;
--- 70,75 ----
***************
*** 894,899 ****
--- 893,899 ----
char *NHistory;
char *NHistorydir;
char *NHistorypag;
+ char *EXPhistdir;
char buff[SMBUF];
register FILE *out;
BOOL Server;
***************
*** 915,920 ****
--- 915,927 ----
UnlinkFile = FALSE;
(void)umask(NEWSUMASK);
+ /* find the default history file directory */
+ EXPhistdir = COPY(_PATH_HISTORY);
+ p = strrchr(EXPhistdir, '/');
+ if (p != NULL) {
+ *p = '\0';
+ }
+
/* Parse JCL. */
while ((i = getopt(ac, av, "f:h:d:g:ilnpqr:stv:w:xz:")) != EOF)
switch (i) {
***************
*** 1037,1044 ****
out = NULL;
else {
/* Open new history files, relative to news lib. */
! if (chdir(EXPnewslib) < 0) {
! (void)fprintf(stderr, CANTCD, EXPnewslib, strerror(errno));
exit(1);
}
out = EXPfopen(TRUE, NHistory, "w");
--- 1044,1051 ----
out = NULL;
else {
/* Open new history files, relative to news lib. */
! if (chdir(EXPhistdir) < 0) {
! (void)fprintf(stderr, CANTCD, EXPhistdir, strerror(errno));
exit(1);
}
out = EXPfopen(TRUE, NHistory, "w");
***************
*** 1140,1147 ****
(void)printf("Expire tracing: history files not updated.\n");
}
if (!Bad && !EXPtracing) {
! if (chdir(EXPnewslib) < 0) {
! (void)fprintf(stderr, CANTCD, EXPnewslib, strerror(errno));
CleanupAndExit(Server, Paused, 1);
}
/* If user used the -d flag, mark we're done and exit. */
--- 1147,1154 ----
(void)printf("Expire tracing: history files not updated.\n");
}
if (!Bad && !EXPtracing) {
! if (chdir(EXPhistdir) < 0) {
! (void)fprintf(stderr, CANTCD, EXPhistdir, strerror(errno));
CleanupAndExit(Server, Paused, 1);
}
/* If user used the -d flag, mark we're done and exit. */
Technical Details
Message-ID:
<yy3919z782o.fsf@bb.home.vix.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mailReferences:
<5128ri$59s@queeg.apci.net> <514f0a$7uk@vertex.tor.hookup.net>Show Full Headers
Complete Article Headers
Message-ID: <yy3919z782o.fsf@bb.home.vix.com> Subject: Re: inn1.4u4 BUG (was Re: Expire pauses but never unpauses) Date: Tue, 24 Sep 1996 00:00:00 +0000 From: James Brister <brister@vix.com> References: <5128ri$59s@queeg.apci.net> <514f0a$7uk@vertex.tor.hookup.net> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail X-Deja-AN: 185139894 Sender: brister@bb.home.vix.com Cc: brister@vix.com, sawyerk@apci.net Organization: Vixie Enterprises Newsgroups: news.software.nntp