[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
pkg/38051: security/sfs recent patch uses __NetBSD_Prereq__ incorrectly
>Synopsis: security/sfs recent patch uses __NetBSD_Prereq__ incorrectly
>Arrival-Date: Mon Feb 18 12:20:02 +0000 2008
>Originator: Robert Elz
>Release: NetBSD 3.99.15 (pkgsrc current within past 4 hours)
Prince of Songkla University
System: NetBSD jade.coe.psu.ac.th 3.99.15 NetBSD 3.99.15
(GENERIC-1.696-20060125) #8: Wed Jan 25 04:59:39 ICT 2006
I compile packages using pkg_comp and libkver for a NetBSD 3.0
environment (then they work on everything I care abuot).
Until Saturday, security/sfs compiled file. Then
Deal with fourth arg to mount(2) in NetBSD. It appeared between
4.99.23 and 4.99.24.
That's clearly something that needed doing, but it needs
The test added was ...
#elif defined(__NetBSD__) && __NetBSD_Prereq__(4,99,24)
which (as any sand person would read it) tests for 4.99.24 or
later, as a prerequsisite.
But what it really tests is if 4.99.24 is >= __NetBSD_Version__
which is clearly true (for me), as __NetBSD_Version__ is 3.0.0
I (still) suspect that the "sense" of __NetBSD_Prereq__() is
more intended to be used in LKMs, where the appropriate think
to know is that the kernel hasn't been made newer than the
LKM author knows about (which might mean that any internal
kernel interface has altered, so the LKM needs to be checked
for continued correct design).
Attempt to build security/sfs (on presumably just about
anything except 4.99.24 where it will presumably work).
I suspect the correct line should be
#elif defined(__NetBSD__) && !__NetBSD_Prereq__(4,99,23)
which tests that 4.99.23 < __NetBSD_Version__
(ie: !(4.99.23 >= __NetBSD_Version))
That is, the system being compiled against is 4.99.24
or later, which is (apparently) where the change is required.
Probably better is just to forget __NetBSD_Prereq__() and simply
#elif defined(__NetBSD__) && __NetBSD_Version__ >= 499002400
I can't test either of those is exactly what is needed, as I don't
have 4.99.23 and 4.99.24 systems around to validate it (and
don't really feel inclined to build them just for this).
I have submitted this PS as high/serious, not because it is
really urgent that security/sfs get fixed, but because it is
urgent that there be some documentation for __NetBSD_Prereq__()
so people actually know how to use the thing (which all relates
back to a pending PR of mine that ought to eb closed now, since
4.0 was released, and it was only ever relevant to what was
released as 4.0) and a discussion on tech-kern that (to me)
only ended up demonstrating that __NetBSD_Prereq__() is either
misunderstood or simply useless and irrelevant (and so should
either be documented, or deleted).
ie: After processing this PR against security/sfs, please
change its category to kern and leave it open instead of
closing it, if that's possible...
ps: with the changed patch, security/sfs does build on 3.0 at least.
Main Index |
Thread Index |