Bug 587 - incorrect type causes .newsrc corruption
incorrect type causes .newsrc corruption
Status: CLOSED CURRENTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: trn (Show other bugs)
5.2
i386 Linux
high Severity high
: ---
: ---
Assigned To: Bill Nottingham
:
: 277 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 1998-12-25 19:06 EST by tzs
Modified: 2014-03-16 22:08 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 1999-02-10 17:15:21 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description tzs 1998-12-25 19:06:31 EST
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 18:52:59 EST
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 14:00:59 EST
Unable to replicate #277 in test lab, but logic is correct and should
be fixed.
Comment 3 tzs 1998-12-29 15:01:59 EST
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 07:56:59 EST
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 09:58:59 EST
*** 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@redhat.com  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@cornell.edu  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@pharmapartners.nl  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@cornell.edu  01/06/99 00:39 -------
This is a duplicate of #587
Comment 6 Mike Maher 1999-02-10 17:15:59 EST
Updating packages for Rawhide..  ammended bug for trn from report for
next release.

Note You need to log in before you can comment on or make changes to this bug.