Bug 587

Summary: incorrect type causes .newsrc corruption
Product: [Retired] Red Hat Linux Reporter: tzs
Component: trnAssignee: Bill Nottingham <notting>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: 5.2CC: aleksey, rvokal, vek
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 1999-02-10 22:15:21 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description tzs 1998-12-26 00:06:31 UTC
In the file rcln.c, there is code like this:

bool morenum;
...
morenum = isdigit(*s);

"bool" is defined as char, and isdigit returns an int.  On
glibc on little-endian processors, that int is >256 when *s
is a digit, which gets truncated to 0 when stuffed into a
char.  Oops.

Two ways to fix: (1) change bool to bool_int.  That's what
the Debian people did last February.  (2) In common.h, chang
"#define bool char" to "#define bool int", so that any other
places that any other places that have this problem will get
fixed.  I have asked the maintainer of trn about this, and
he says #2 is an OK fix.

Note: I reported this bug, and this fix, back in August.
Please don't lose it this time.

Comment 1 Aleksey Nogin 1998-12-26 23:52:59 UTC
This was already discussed in bug report #277, but never was fixed
(report #277 was discarded for no apparent reason)

Comment 2 Jay Turner 1998-12-29 19:00:59 UTC
Unable to replicate #277 in test lab, but logic is correct and should
be fixed.

Comment 3 tzs 1998-12-29 20:01:59 UTC
Best way to reproduce is to read a few random articles in
comp.os.linux.advocacy, or any other group where a lot of articles are
cross-posted.  The effect of the bug is that when trn updates the
entries for those other groups in .newsrc, it botches, and you end up
with entries that have the comas in the wrong place.  E.g., instead of
1-500,505,507,510,520-530, you might get 1-500,505,,,507510520-530.

Note that trn won't complain about the problem until you get to one of
the groups whose entry is corrupted, and it does *NOT* corrupt the
group you are currently reading in, so it can appear that the
corruption had nothing to do with what you were actually doing.

Comment 4 vek 1999-01-29 12:56:59 UTC
Was there eny plan to actually fix this?  If so you can close this
as well as 277 when the fix has been made.

Comment 5 Jeff Johnson 1999-02-02 14:58:59 UTC
*** Bug 277 has been marked as a duplicate of this bug. ***


The trn news reader often looses the list of already read
articles.  It occurs after you get a warning that someone
has modified the news group and that it is now assumed that
nothing is read.


Difficult to explain the symptoms, but the problem occurs in
the source file rcln.c around line 81:

The variable morenum is now a 8 bit bool type, but should be
at least 16 bit in orer to hold the result if isdigit()

The result is that the variable morenum is always false, and
that causes the list of read articles to become garbeled.




The problem poped up while reading the comp.os.linux groups
with several thousane articles, and a lot of crossposts
within these groups.  The rpoblem is related to mark all
occurences of a crossposted article as read.




Regards


Villy Kruse

------- Additional Comments From jturner  12/08/98 15:06 -------
Can you give us more information about any messages that you get when
this deletion occurs.  It sounds as if you are getting caught in the
expire cycle on your newsreader.  Is this a correct statement?

------- Additional Comments From ayn2  12/22/98 22:26 -------
It seems the person who closed the bug did not read the bug e-mail
directory. I believe this bug should be reopened.

------- Additional Comments From vek  01/05/99 09:16 -------
The problem was not fixed

See my e-mail messages where my full message is to be found.

Villy

------- Additional Comments From ayn2  01/06/99 00:39 -------
This is a duplicate of #587

Comment 6 Mike Maher 1999-02-10 22:15:59 UTC
Updating packages for Rawhide..  ammended bug for trn from report for
next release.