[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: pkg_info bug



On Tue, Mar 09, 1999 at 09:13:00AM +0200, Denis A. Doroshenko wrote:
> i checked the patch to /cvs/src/usr.sbin/pkg_install/info/show.c applied 
> by Marco S Hyman that absolutely matches one advised in the message pasted 
> below. well, i may be misuderstand something, but i think there should be 
> test for line_length is not equal to zero, if it is the next reference to 
> line[-1] will cause problems. ok, it should be rare case when this may 
> happen, but i guess, resolving old problems we shouldn't create newer 
> ones, should we? btw, fgets/strlen are not the best "twix", since their 
> result not always corresponds to reality.

> weird, in same file (show.c) different functions use differnt subrotines 
> for file reading: show_file() (line 64) uses fread() and show_index() 
> (line 85) uses fgets() ... to do the same (display content of file)?

the pkg_* tools are definitely not the cleanest packages on earth, which is
why rushing and installing new stuff is the wrong approach.

Essentially, fixing this at pkg_info is only a band-aid. The main question is:
why aren't correct COMMENT files installed in the first place ? there
are fixes to add to all other package tools FIRST. 

Actually, I would be of a mind to make pkg_info break spectacularly (I mean:
write out a huge warning message in fiery letters that a COMMENT file is
flaky, or missing, or whatever, but not dump core, or display weird things)
so that we fix the real problem... which is getting wrong COMMENT files let
installed in the first place.
-- 
	Marc Espie		
|anime, sf, juggling, unicycle, acrobatics, comics...
|AmigaOS, OpenBSD, C++, perl, Icon, PostScript...
| `real programmers don't die, they just get out of beta'