NNTPC: CurrentDir not properly tracking cwd

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I found that I was getting an incomplete News hierarchy in the <cacheDir>
directory, when the whole hierarchy should be in <cacheDir>/<server host>.
(I have only one upstream server host at the moment.)

It turns out that CurrentDir isn't properly tracking cwd, and that for
instance a newly forked nntpcached often starts out with CurrentDir set to
<cacheDir>/<server host>, but real cwd <cacheDir>. This is due to several
places where chdir (con.cacheDir) is done without CurrentDir being updated.

For my needs, it was enough to invalidate CurrentDir in one place:

*** list.c.orig	Fri Nov  8 21:29:00 1996
--- list.c	Sun Feb  9 19:10:48 1997
***************
*** 339,344 ****
--- 339,345 ----
  			Stats->list_overview_fmt_cached_bytes = bytes;
  		}
  		chdir (con.cacheDir);
+ 		strcpy(CurrentDir, "");		/* Invalidate */
  		return bytes;
  	}
  	log (("merging '%s' from %s with existing group information", list->name, scfg->host));

Note that this is not a general solution - there are still several places
(for instance when running the "updatedaemon") where real cwd is updated
without a corresponding update to CurrentDir. I don't know how important
these are...

Steinar Haug, Nethelp consulting, sthaug@nethelp.no


[Index of Archives]     [Yosemite]     [Yosemite Campsites]     [Bugtraq]     [Linux]     [Trn]

Powered by Linux