[news.software.nntp] Bug in rn from nntp1.5

janick@crk56.bnr.com (Janick Bergeron 1617964) (10/05/89)

I have found (and corrected) a bug in rn I got with nntp1.5.

The bug is at line #107 in the file art.c:

    if (filestat.st_mode & S_IFMT != S_IFREG)
	return DA_NORM;

should be replaced by:

    if ((filestat.st_mode & S_IFMT) != S_IFREG)
	return DA_NORM;


The operators were evaluated in the wrong order: Instead of checking
if the article was a regular file, it checked if 'others' had execute
permission.

jim@eda.com (Jim Budler) (10/07/89)

janick@crk56.bnr.com (Janick Bergeron 1617964) writes:

} I have found (and corrected) a bug in rn I got with nntp1.5.

} The bug is at line #107 in the file art.c:
}     if (filestat.st_mode & S_IFMT != S_IFREG)
} 	return DA_NORM;

} should be replaced by:

}     if ((filestat.st_mode & S_IFMT) != S_IFREG)
} 	return DA_NORM;




This is present in the non-nntp version of rn also, so it's not just
related to the version distributed with nntp. (Patchlevel 40).

jim
-- 
Jim Budler	jim@eda.com    ...!{decwrl,uunet}!eda!jim
compuserve: 72415,1200     applelink: D4619
voice: +1 408 986-9585     fax: +1 408 748-1032