Newsgroups: news.software.b Path: utzoo!utstat!geoff From: geoff@utstat.uucp (Geoff Collyer) Subject: C News Bulletin #5 - rnews bugs and caveats Message-ID: <1987Dec16.025423.18295@utstat.uucp> Organization: Statistics, U. of Toronto Date: Wed, 16-Dec-87 02:54:22 EST The C news alpha release contains bugs and bad behaviours, as promised in the README files. Here are some of the more prominent ones in rnews and friends (most bugs uncovered thus far have been fairly minor). Chris Lewis found that libc/putenv.c doesn't always return a value. (Oops, I guess putenv hadn't been linted recently.) The fix is to change the two occurrences of "return;" to "return YES;". It has been observed that this putenv's return value differs from the System V putenv's; the difference will be reconciled before final release. rnews/fileart.c fails to set errno when appropriate on systems lacking a 3-argument open (e.g. V7). (I never should have let utcsstat, our V7 11/70 go!) Henry found and fixed this in a more recent (and quite different) form of this code. An equivalent fix to the alpha release code is to change this code in openlink() starting at about line 238 from if (access(sp, F_OK) >= 0) /* sp exists */ *tfp = NULL; /* refuse to write on it */ else to if (access(sp, F_OK) >= 0) { /* sp exists */ extern int errno; errno = EEXIST; *tfp = NULL; /* refuse to write on it */ } else Alan Hargreaves found a few typos: libc/makefile refers to libc/memlist.c; just delete the reference. rnews/system.h defines FLG_IHAVE and FLG_IHAVEOLD, which are not unique in their first nine characters; Alan's fix is to change FLG_IHAVEOLD to FLG_OLDIHAVE everywhere. Alan also found that inews does not understand newsgroups of the form all.all.ctl. There are several possible fixes, but I haven't applied any of them yet (I feed my control messages to rnews or relaynews directly, by hand). I plan to emit a "Control:" header cloned from the "Subject:" line and delete ".ctl", as for "Subject: cmsg foo", since this form of control message explicitly does not conform to RFC 850 (it's a backwardly compatible hack). relaynews -p prints a spurious "relaynews: articleshort by 2147482799 bytes" complaint when fed an unbatched article. This is annoying but harmless. It's caused by overloading -p and will be fixed by introducing more options to relaynews (yes, a cop-out). Those are the bugs; now a bit of vague philosophy to ward off flames (too late, alas). Aside from a dig at System V for not including dbm(3) (ATTIS folks, that's a hint), there is no built-in bias in C news towards System V or 4.2BSD. We have been accused of bias in favour of both(!), which may be because we use library functions from both (and provide emulations for those who lack them), thus offending those in each camp. We intend C news to be portable and it already runs on at least V7, System V, 4.2BSD, PDP-11s, Suns, VAXen, and Dual 68k boxes. I expect it will run on V8 and V9, and it will in time. I have tried to keep #ifdefs out of the code, so porting to another Unix variant (e.g. a faster SVR3 port) is simply a matter of making up a new vers directory, populating it, and fixing rnews/makefile (well, you might have to fix up expire too). Having said that, C news does use some little-used or unusual features of Unix, notably close-on-exec file descriptors, exclusive creat (3-argument open), fork(), and traditional (non-symbolic or ``hard'') links. A port to Eunice, MS/DOS or CMS is not guaranteed to be easy. Henry has commented on the mess of shell scripts front-ending relaynews. The situation is better now, though the shell scripts are still evolving. It is important to realise that the shell scripts, notably inews, rnews, serverrnews and realrnews, are meant as prototypes: if they work for you, great; if not, adapt them to your local needs. That's the major reason that they *are* shell scripts: so that people can adapt them without wading into unfamiliar C code. (As one who had to wade into B news to adapt it to local circumstances, I certainly appreciate the malleability of shell scripts.) -- Geoff Collyer utzoo!utstat!geoff, utstat.toronto.{edu,cdn}!geoff