I would like a sponsor for several pkgchk related issues.

See http://www.petertribble.co.uk/Solaris/fixes/1/ for details
(given below) and diffs.

1. 6218542 (also the core reported in 5035606)

Removed the call to selpath. The problem is that the first branch of
the preceding if block has already taken ppathlist[n] off the end of
the array - replacing n with 0 stops the crash, but in fact checkmap
also has exactly the same code, so that it's better to remove this
call completely.

(I've also removed the forward declaration of selpath from main.c as
it's no longer necessary. And selpkg too.)

This also solves the problem of duplicate output such as the

pkgchk -p hjzxv
NOTE: Couldn't lock the package database.
WARNING: no information associated with pathname <hjzxv>
WARNING: no information associated with pathname <hjzxv>

2. 6412140

Rewritten the ELF check for the file referenced by the -i flag. I
presume that this feature is to guard against supplying a binary file
as input, but it also catches genuine cases. So I explicitly check just
the first 4 characters of the file for the ELF signature.

3. 6412749

Enhanced to allow -i input file to be specified on stdin.

Check and generate an error on empty input file.

This last check adds an extra error message.

4. 6412765

I guard against overly long input strings (doesn't do anything
smart, but doesn't crash).

I do this by adding a length specifier to fscanf. (Ideally this would
use PATH_MAX rather than being hardcoded to 1024, but I'm not sure how
to get a numeric define in a format specifier past the preprocessor.)

5. 6322837

I've added a simple check that the input file specified is indeed a
regular file.

Note that this actually constitutes a change of behaviour, and will
cause anything that explicitly uses /dev/stdin (rather than the more
conventional notation - see point 3 above) to fail. I have identified 2
places where this occurs


6. 6413788

Fixed various typos and removed unused defines.

-Peter Tribble
L.I.S., University of Hertfordshire - http://www.herts.ac.uk/
http://www.petertribble.co.uk/ - http://ptribble.blogspot.com/

Reply via email to