home *** CD-ROM | disk | FTP | other *** search
- /*
-
- JZ rnews.c V1.4 for C news
-
- C News has a fair amount of overhead in all the processes that get run
- between rnews and relaynews. This program eliminates most of this
- overhead for a substantial performance increase. I measure ~40% on my
- tests with 200k before compression batches. Performance improvement
- will be higher on smaller batches or with uncompressed feeds.
- Basically, things go right from rnews into relaynews.
-
- Much of this overhead is concerned with disk space. IMHO, there are
- better ways of doing disk space managment than C New's limited method
- of not unpacking news if the disk is full. If news is continuing to
- come in, one is just delaying the inevitable (throwing away news)
- anyway. There are other, more effective ways to take care of disk
- space; a progressive expire (see below) and a uucp that is smart
- enough to quit accepting incoming news when space is low and possibly
- understands a temporary failure return code.
-
- This rnews has an option to do progressive expires if there is not
- enough space on the spool partition. The advantage of this is that
- you can run right on the edge of a full disk without ever worrying
- about losing news or trying to estimate how much will come in before
- you run expire again. These are "expire -r"s; they run reasonably
- fast. If expire tends to slow your system down excessively, you may
- want to consider adding a sleep() to expire to make the system more
- usable while expire is running. A cnews example (expire.c):
-
- while ((line = readline(old)) != NULL) {
- > unsigned int slowdown=0;
- > if (++slowdown % 50 == 0) sleep(1);
- line = doline(line);
-
- Note that you should still run expire from cron now and then to
- rebuild the history file (use dbz). Be sure to create the
- /usr/lib/news/explist.[A-E] files.
-
- C News makes some attempts to address local news security but leaves
- some holes (newsspool and relaynews) that make some of this a wasted
- effort. You don't ever want a user directly or indirectly running a
- news owned program while their uid is exposed. There is little sense
- in using another id (such as news) if breaking that id (or purposely
- giving the passwd so someone can administer news) allows one to
- break many others by a trojan horse attack. This program runs suid
- root and immediately gives it up. It cures the problem of a uid being
- exposed through the rnews/newsspool entry point. If you install the
- supplied relaynews.c the other entry point (inews/relaynews) will be
- secure from this attack. You can get rid of setnewsids and change
- newsspool and relaynews.real permissions and ownership to be like the
- other files.
-
- This program should be in a public bin directory and:
-
- -rws--x--x root bin rnews
-
- Tested on SUNOS 4.0, Sys III (a 16 bit machine), and a Sys V.3.1 system.
-
- Copyright 1989 Jon Zeeff <zeeff@b-tech.ann-arbor.mi.us>
-
- You can do whatever you want with this code provided you:
-
- 1) leave my name on it
- 2) don't hold me responsible for any problems
- 3) report all bugs and modifications to me via email
-
- Support for c7decode added by Uwe Doering <gemini@netmbx.UUCP>
- I used the original Cnews c7decode.c with slight modifications.
- */
-