🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
15 messages
15 total messages Started by RD Francis Thu, 27 Jun 1991 17:41
Two queries regarding C-News (one of which also hits rn)
#148
Author: RD Francis
Date: Thu, 27 Jun 1991 17:41
26 lines
2232 bytes
Well, we've finally switched over to our new machine running C-News
(with Dave Alden's nntplink stuff, and Rich $alz's newsgate).  Most
things are going smoothly, but I do have a couple of questions:

1)  Evidently BNews inews (or at least our copy of it) checked for
multiple occurrences of the same group in the Newsgroups: line, and
removed them, so articles with lines like "Newsgroups: test,test"
would only get posted to test once.  Now, articles with the Newsgroups
header described above get posted twice.  Is this the way things are
supposed to be,or not?  (We've got a piece of software we wrote that
assumes that the duplicates will be weeded out of Newsgroups, which
I'm willing to work on to resolve the problem on our end; I was just
curious as to whether or not the behaviour we're seeing is considered
correct)

2)  This one is much more serious.  rn users have, on two or three
separate occasions now, been told that all of their newsgroups were
bogus, and been unsubscribed from everything.  I suspect that this has
occurred at the same time as I've been running addgroup (and maybe
delgroup).  I've changed newgroup so new groups are not automatically
created, and run addgroup myself.  My suspicion is that when addgroup
(again, or delgroup) changes the active and active.times files, rn is
getting seriously confused.  Does anyone have any suggestions?
--
R David Francis   francis@cis.ohio-state.edu
Re: Two queries regarding C-News (one of which also hits rn)
#150
Author: Henry Spencer
Date: Thu, 27 Jun 1991 20:12
23 lines
1803 bytes
In article <CMM.0.88.678044489.francis@wolfman.cis.ohio-state.edu> francis@cis.ohio-state.edu (RD Francis) writes:
>1)  Evidently BNews inews (or at least our copy of it) checked for
>multiple occurrences of the same group in the Newsgroups: line, and
>removed them, so articles with lines like "Newsgroups: test,test"
>would only get posted to test once.  Now, articles with the Newsgroups
>header described above get posted twice.  Is this the way things are
>supposed to be,or not? 

Our position tends to be that if the group appears twice, that means the
article appears twice.  There is some possibility this might eventually
get optimized, but don't hold your breath.

>2)  This one is much more serious.  rn users have, on two or three
>separate occasions now, been told that all of their newsgroups were
>bogus, and been unsubscribed from everything...

No ideas about this one.  There is inherently a short window during a
delgroup when files are being rewritten, but I'd be surprised if rn was
consistently hitting it.
-- 
Lightweight protocols?  TCP/IP *is*     | Henry Spencer @ U of Toronto Zoology
lightweight already; just look at OSI.  |  henry@zoo.toronto.edu  utzoo!henry
Re: Two queries regarding C-News (one of which also hits rn)
#161
Author: Alexis Rosen
Date: Fri, 28 Jun 1991 08:45
34 lines
2256 bytes
henry@zoo.toronto.edu (Henry Spencer) writes:
>francis@cis.ohio-state.edu (RD Francis) writes:
>>2)  This one is much more serious.  rn users have, on two or three
>>separate occasions now, been told that all of their newsgroups were
>>bogus, and been unsubscribed from everything...
>
>No ideas about this one.  There is inherently a short window during a
>delgroup when files are being rewritten, but I'd be surprised if rn was
>consistently hitting it.

I can't believe you guys haven't been asked about this one zillions of times.
It messed me up good before I modified delgroups. I've been meaning to post
a request for you to fix/change this for a while, since it may not be a bug,
but it's definitely a deficiency.

The problem is that if you run delgroups as root, the active file becomes
owned by root. And if UMASK is to 600 (or do I mean 177?), the new active
file won't be readable by others (this last is supposition, since I've only
been bitten by part one, but that's bad enough).

Of course, you _should_ run delgroups as news, but since none of us are perfect
and news tasks are often dealt with by an admin running as root (again,
despite "better practice" rules), I think delgroups should have lines to
do appropriate chowns and chmods.

Come to think of it, this may not be his problem, since this would require
human intervention to be fixed. But it should be dealt with anyway...

---
Alexis Rosen
Owner/Sysadmin, PANIX Public Access Unix, NY
alexis@panix.com
{cmcl2,apple}!panix!alexis
Re: Two queries regarding C-News (one of which also hits rn)
#163
Author: Ian Dickinson
Date: Fri, 28 Jun 1991 09:49
27 lines
2190 bytes
In article <1991Jun27.201257.29111@zoo.toronto.edu> henry@zoo.toronto.edu (Henry Spencer) writes:
>In article <CMM.0.88.678044489.francis@wolfman.cis.ohio-state.edu> francis@cis.ohio-state.edu (RD Francis) writes:
>>2)  This one is much more serious.  rn users have, on two or three
>>separate occasions now, been told that all of their newsgroups were
>>bogus, and been unsubscribed from everything...
>
>No ideas about this one.  There is inherently a short window during a
>delgroup when files are being rewritten, but I'd be surprised if rn was
>consistently hitting it.

I had this problem and put it down the way delgroup replaces the active
file, and rn does seem to get confused during that.  Similarly,
if I left an rn running overnight, it often got confued when I pressed
a key because expire had done something similar.

I don't have the problem anymore, since I use trn (rn is a link to trn)
which uses the active2 file which mthreads creates.

None of the other newsreaders in use here seem to have the problem.

Ciao,
-- 
\/ato                                                               /'\  /`\
Ian Dickinson                 TED KALDIS FOR PRESIDENT!            /^^^\/^^^\
vato@warwick.ac.uk                                                /TWIN/TEATS\
@c=GB@o=University of Warwick@ou=Computing Services@cn=Ian Dickinson  /       \
Re: Two queries regarding C-News (one of which also hits rn)
#168
Author: Henry Spencer
Date: Fri, 28 Jun 1991 17:07
19 lines
1556 bytes
In article <1991Jun28.084515.29919@panix.uucp> alexis@panix.uucp (Alexis Rosen) writes:
>The problem is that if you run delgroups as root...
>... I think delgroups should have lines to
>do appropriate chowns and chmods.

No.

There is fundamentally no way we can bulletproof our software against
incompetent administrators; we refuse to expend substantial efforts trying.
And the effort *is* substantial, because those "lines to do appropriate
chowns and chmods" are Unix-version-dependent and need to be configurable
in several ways.  We're also unhappy at the thought of the sheer number
of files that would need to have such lines sprinkled into them.

As you mention, this doesn't sound like RDF's problem.
-- 
Lightweight protocols?  TCP/IP *is*     | Henry Spencer @ U of Toronto Zoology
lightweight already; just look at OSI.  |  henry@zoo.toronto.edu  utzoo!henry
Re: Two queries regarding C-News (one of which also hits rn)
#189
Author: Alexis Rosen
Date: Sat, 29 Jun 1991 10:46
46 lines
2972 bytes
henry@zoo.toronto.edu (Henry Spencer) writes:
>alexis@panix.uucp (Alexis Rosen) writes:
>>The problem is that if you run delgroups as root...
>>... I think delgroups should have lines to
>>do appropriate chowns and chmods.
>There is fundamentally no way we can bulletproof our software against
>incompetent administrators; we refuse to expend substantial efforts trying.
>And the effort *is* substantial, because those "lines to do appropriate
>chowns and chmods" are Unix-version-dependent and need to be configurable
>in several ways.  We're also unhappy at the thought of the sheer number
>of files that would need to have such lines sprinkled into them.

Would you please explain this? I'm willing to be convinced but I don't see
how this can be. You already know about chown and chmod from the build script.
And you already know what the name of the news ID is. What more do you need?
Is there really a Unix where
chmod 644 active ; chown news active
won't do the trick? (You'd use variables, of course, I'm just keeping things
simple.

(Hm. Thinking about it, does active have to belong to the news _group_ as well
as ID? It still shouldn't matter- you know about that from build too.)

Also, how many such scripts are there? The only one I've ever run into on this
is delgroup. (There may be others that I've never messed up with.)

If you only did the "right" think, Cnews would be lots smaller, a little
faster, and too troublesome for many people to run. Fortunately for us all,
you generally do the good thing instead of the right thing, at least enough
for us to generally cope. ("Do the good thing"? Spike Lee's sequel? :-)

I think that the delgroups problem is a common enough failure that it's worth
a few extra lines of code.

While I'm discussing scripts, on A/UX addgroups fails to figure out the name
of the creator, if a group is created locally. That's because $USER isn't
defined. But $LOGNAME does. I'm not sure but I think some other unixes have
this too. If so, could you use "${USER-${LOGNAME-unknown}}" instead of
"${USER-unknown}" in addgroups?

---
Alexis Rosen
Owner/Sysadmin, PANIX Public Access Unix, NYC
alexis@panix.com
{cmcl2,apple}!panix!alexis
Re: Two queries regarding C-News (one of which also hits rn)
#191
Author: Rob McMahon
Date: Sat, 29 Jun 1991 12:56
42 lines
2567 bytes
In article <CMM.0.88.678044489.francis@wolfman.cis.ohio-state.edu>
francis@cis.ohio-state.edu (RD Francis) writes: 
>rn users have, on two or three separate occasions now, been told that all of
>their newsgroups were bogus, and been unsubscribed from everything.  I
>suspect that this has occurred at the same time as I've been running addgroup
>(and maybe delgroup).

One reason I know for this is NFS.  If you remove a file from the server while
a client has it open, all operations on the file will fail with ESTALE.  So
programs that update the file in place are fine, as are programs which do

	<create active.new>
	rm -f active.old
	ln active active.old &&	mv active.new active

the *first* time.  If you repeat this, however, the file which an `rn' running
on a client has open no longer exists, and it panics and thinks all the groups
have been removed.

`Addgroup' uses the first method, `delgroup' uses the second method, and cause
this problem (well in fact it does `mv active active.old ; mv active.tmp
active': wouldn't the above be better ? (no time when active doesn't exist)).
`Expire' and `upact', but I think not `updatemin', also do this which can
cause trouble if you leave rn running overnight.

The real solution must be to change rn to notice that read operations are
failing, and to close and reread the active file.  Another solution would be
to use something like

	ln active "active.keep/`date`.$$"

instead, and mopup after all "reasonable" rn's should have exited (a day or
two ?).

Cheers,

Rob
-- 
UUCP:   ...!mcsun!ukc!warwick!cudcv	PHONE:  +44 203 523037
JANET:  cudcv@uk.ac.warwick             INET:   cudcv@warwick.ac.uk
Rob McMahon, Computing Services, Warwick University, Coventry CV4 7AL, England
Re: Two queries regarding C-News (one of which also hits rn)
#195
Author: Ronald S H Khoo
Date: Sat, 29 Jun 1991 18:37
39 lines
2380 bytes
alexis@panix.uucp (Alexis Rosen) writes, in reply to henry@zoo.toronto.edu
(Henry Spencer) who is:

henry> also unhappy at the thought of the sheer number
henry> of files that would need to have such lines sprinkled into them.

alex> Would you please explain this? I'm willing to be convinced but I don't
alex> see how this can be. You already know about chown and chmod from the
alex> build script And you already know what the name of the news ID is.
alex> What more do you need?

One major problem with chown()ing as a solution is that you have to remember
to do it after creating just about any file at all.  Yuk.  Half of the
volume of the news scripts would end up being devoted to this.

Another thing is that it doesn't seem elegant to choose a solution
with all these nasty races, when the real solution is simply to ensure
that all maintenance scripts are run as news.  This has other advantages
anyway.

However, "there is no portable way" in which a script can determine who
it's run as.

	test "`whoami`" = news || die_with_error_message

seems conceptually right, but can be confused by multiple entries in /etc/passwd
for news, and the fact that System V would need a "whoami" shell script:

	#!/bin/sh
	expr "`id`" : 'uid=[0-9]*(\([^)]*\))'


which will break the next time that USL decides to change the output format
of /bin/id.  However, I'd like to see some form of "whoami" emulation
anyway, because it's useful.

-- 
Ronald Khoo <ronald@robobar.co.uk> +44 81 991 1142 (O) +44 71 229 7741 (H)
Re: Two queries regarding C-News (one of which also hits rn)
#208
Author: Matthias Urlichs
Date: Sun, 30 Jun 1991 07:06
17 lines
1595 bytes
In news.software.b, article <=05{_AC@warwick.ac.uk>,
  cudcv@warwick.ac.uk (Rob McMahon) writes:
< 
< The real solution must be to change rn to notice that read operations are
< failing, and to close and reread the active file.  Another solution would be
< to use something like
< 
Another solution would be to update the active file in place, and instead of
removing the entry you replace the "y" or "m" with "x" or "n", depending on
whether you still want to forward articles in that newsgroup.

Newer versions of rn and hopefully all other news readers ignore newsgroups
with "x" flags. I don't know what it doesn with "n", though.

-- 
Matthias Urlichs -- urlichs@smurf.sub.org -- urlichs@smurf.ira.uka.de     /(o\
Humboldtstrasse 7 - 7500 Karlsruhe 1 - FRG -- +49-721-621127(0700-2330)   \o)/
Re: Two queries regarding C-News (one of which also hits rn)
#221
Author: Henry Spencer
Date: Sun, 30 Jun 1991 23:40
45 lines
3369 bytes
In article <1991Jun29.104655.11340@panix.uucp> alexis@panix.uucp (Alexis Rosen) writes:
>>And the effort *is* substantial, because those "lines to do appropriate
>>chowns and chmods" are Unix-version-dependent and need to be configurable
>>in several ways.  We're also unhappy at the thought of the sheer number
>>of files that would need to have such lines sprinkled into them.
>
>Would you please explain this? I'm willing to be convinced but I don't see
>how this can be. You already know about chown and chmod from the build script.

We do... but plugging that information into a number of scripts is painful,
because the existing configuration mechanisms aren't very suited to it.  The
chances are good, in fact, that build is going to lose those queries, and
the tiny bit of shell file that is so painfully generated from them, in favor
of a couple of lines of instructions saying "create the following directories
with the following ownerships and permissions".

>Is there really a Unix where
>chmod 644 active ; chown news active
>won't do the trick? ...

Yes.  In an off-the-shelf SunOS 3.2 (to name the example I have combat
experience with; I'm sure there are more) chown is not even in the normal
search path.

>...how many such scripts are there? The only one I've ever run into on this
>is delgroup. (There may be others that I've never messed up with.)

The problem is, what do we tell the customer?  That *some* of the scripts
are root-proofed and some aren't?  Different sysadmins use different things
frequently; the only practical way is to promise either that *all* of them
are root-proof or that *none* of them are.

>While I'm discussing scripts, on A/UX addgroups fails to figure out the name
>of the creator, if a group is created locally. That's because $USER isn't
>defined. But $LOGNAME does. I'm not sure but I think some other unixes have
>this too. If so, could you use "${USER-${LOGNAME-unknown}}" instead...

Actually, for some time I've been thinking that that mail is kind of
superfluous, so I may delete the mailed notice entirely.  However, you
are correct that hitting LOGNAME as well is probably a good idea; will
fix.  (The creator name is still used for active.times.)  (Sure would
be nice if there were a portable way of determining the login name...)
-- 
Lightweight protocols?  TCP/IP *is*     | Henry Spencer @ U of Toronto Zoology
lightweight already; just look at OSI.  |  henry@zoo.toronto.edu  utzoo!henry
Re: Two queries regarding C-News (one of which also hits rn)
#230
Author: Rob McMahon
Date: Mon, 01 Jul 1991 08:44
16 lines
1333 bytes
In article <=05{_AC@warwick.ac.uk> I wrote:
>...
>	<create active.new>
>	rm -f active.old
>	ln active active.old &&	mv active.new active
>...
>`Expire' and `upact', but I think not `updatemin', also do this which can
>cause trouble if you leave rn running overnight.

Of course expire is updating history, not active.  I blame the BSE.

Mr Spongy.
-- 
UUCP:   ...!mcsun!ukc!warwick!cudcv	PHONE:  +44 203 523037
JANET:  cudcv@uk.ac.warwick             INET:   cudcv@warwick.ac.uk
Rob McMahon, Computing Services, Warwick University, Coventry CV4 7AL, England
Re: Two queries regarding C-News (one of which also hits rn)
#240
Author: Jordan Brown
Date: Mon, 01 Jul 1991 20:49
32 lines
2067 bytes
cudcv@warwick.ac.uk (Rob McMahon) writes:
>francis@cis.ohio-state.edu (RD Francis) writes: 
>>rn users have, on two or three separate occasions now, been told that all of
>>their newsgroups were bogus, and been unsubscribed from everything.

>One reason I know for this is NFS.  If you remove a file from the server while
>a client has it open, all operations on the file will fail with ESTALE.

Basically the same thing happens if you are running AIX TCF (Transparent
Computing Facility) and you lose your network connection to the site
which has the news files.  (Perhaps it went down, perhaps there was a
network problem.)

I made the problem less serious with this patch...  (true.54 is the
rn pl54 distribution.)  With this patch, if you get errors on the
active file rn gives up in disgust instead of trashing your .newsrc.

*** true.54/ngdata.c	Wed Jun 05 20:03:31 1991
--- ./ngdata.c	Sun Dec 16 13:02:17 1990
***************
*** 219,224 ****
--- 219,228 ----
  	    retval = (ACT_POS) ftell(actfp);
  #endif /* lint */
  	}
+ 	if(ferror(actfp)) {
+ 	    perror("error on active file");
+ 	    sig_catcher(0);
+ 	}
  	return (ACT_POS) -1;		/* well, not so quietly, actually */
      }
      else
Re: Two queries regarding C-News (one of which also hits rn)
#248
Author: Jerry Aguirre
Date: Tue, 02 Jul 1991 01:24
21 lines
1921 bytes
In article <1991Jun30.234027.19310@zoo.toronto.edu> henry@zoo.toronto.edu (Henry Spencer) writes:
>Yes.  In an off-the-shelf SunOS 3.2 (to name the example I have combat
>experience with; I'm sure there are more) chown is not even in the normal
>search path.

I agree that peppering the code with chowns is not the solution.  B news
used to change UID to the news owner but that is a little harder for a
shell script.

But how hard its it to check if it is running as the wrong UID and abort
with a nasty message if not?  Alright so whoami et. al. are non
portable.  Does everything have to be a shell script?

How about a small C program that does a stat of the active file and
compares the owner's UID to the UID returned by geteuid.  If they do not
match then it prints an error message and returns a non-zero exit
status.  Add that to doexpire and the other scripts likely to be run by
hand or crontab.  The scripts can then exit if the returned status is
non-zero.  Is that portable enough?

It is far better to have the commands abort than run as root!
Re: Two queries regarding C-News (one of which also hits rn)
#270
Author: Alexis Rosen
Date: Wed, 03 Jul 1991 04:45
61 lines
3870 bytes
henry@zoo.toronto.edu (Henry Spencer) writes:
>alexis@panix.uucp (Alexis Rosen) writes:
>>[...] You already know about chown and chmod from the build script.
>
>We do... but plugging that information into a number of scripts is painful,
>because the existing configuration mechanisms aren't very suited to it.  The
>chances are good, in fact, that build is going to lose those queries, and
>the tiny bit of shell file that is so painfully generated from them, in favor
>of a couple of lines of instructions saying "create the following directories
>with the following ownerships and permissions".

That's a shame. If it already works why kill it? I'll take a wild guess and
say that there are systems this doesn't work with. Well, some systems don't
do lots of things, but for the vast majority that work fine with this, why not
leave it? Request that the user do stuff if the automatic actions fail.

>>Is there really a Unix where
>>chmod 644 active ; chown news active
>>won't do the trick? ...
>
>Yes.  In an off-the-shelf SunOS 3.2 (to name the example I have combat
>experience with; I'm sure there are more) chown is not even in the normal
>search path.

Right. I bumped into that myself just the other day in 4.1. But, you've already
learned thin in the build script. Yes I know you said it might go away, but
in the meantime you know what you need.

>>...how many such scripts are there? The only one I've ever run into on this
>>is delgroup. (There may be others that I've never messed up with.)
>
>The problem is, what do we tell the customer?  That *some* of the scripts
>are root-proofed and some aren't?  Different sysadmins use different things
>frequently; the only practical way is to promise either that *all* of them
>are root-proof or that *none* of them are.

I'd suggest that you don't tell anyone about the safety net at all, lest they
be encouraged to use it. But in a system which runs reasonably OK (I'm not
talking about a total botch that never runs correctly- that's beyond rescue
by a simple shell script fix), I'll bet delgroups and addgroups are called
20 times for each times something else is called. And only delgroups has this
problem.

>Actually, for some time I've been thinking that that mail is kind of
>superfluous, so I may delete the mailed notice entirely.

That's probably the best bet. I don't know why I didn't just do that...

BTW, while I'm playing mathew on the delgroups question :-), I don't think
it's an all-or-nothing isssue. Putting in a simple check-and-refusal if the
user isn't news would do the trick. And while I know there's no totally
portable way to do this, I suggest that you handle this the same way you
handle "spacefor" and "queuelen"- by providing a couple of known examples
and letting the admin figure the rest out. Keeps life simple for you, and
lets you use it in other places too.

---
Alexis Rosen
Owner/Sysadmin, PANIX Public Access Unix, NYC
alexis@panix.com
{cmcl2,apple}!panix!alexis
Re: Two queries regarding C-News (one of which also hits rn)
#285
Author: Henry Spencer
Date: Wed, 03 Jul 1991 17:37
28 lines
2313 bytes
In article <1991Jul3.044557.13527@panix.com> alexis@panix.com (Alexis Rosen) writes:
>>chances are good, in fact, that build is going to lose those queries, and
>>the tiny bit of shell file that is so painfully generated from them, in favor
>>of a couple of lines of instructions saying "create the following directories
>>with the following ownerships and permissions".
>
>That's a shame. If it already works why kill it? I'll take a wild guess and
>say that there are systems this doesn't work with...

Basically, yes.  There are constant headaches with ownerships, and life is
considerably simpler if we avoid the issue rather than trying to build
universal solutions for it.  The problem is not so much variations in the
system software as variations in administrative practice, which are even
harder to predict and deal with.

>>>Is there really a Unix where
>>>chmod 644 active ; chown news active
>>>won't do the trick? ...
>>... SunOS search path ...
>.... But, you've already learned thin in the build script...

Yes... but "chmod 644 active; chown news active" *doesn't* work, and
something more complex and more configurable has to be done.  This I think
I could deal with, but it's a painful nuisance, and finding every place
where one of those shell scripts creates a file would be even worse.
-- 
Lightweight protocols?  TCP/IP *is*     | Henry Spencer @ U of Toronto Zoology
lightweight already; just look at OSI.  |  henry@zoo.toronto.edu  utzoo!henry
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads