Re: CVS commit: src/sys/arch/i386/stand/boot

2011-02-27 Thread David Laight
On Sat, Feb 26, 2011 at 06:22:59PM +, Jonathan A. Kollasch wrote:
 Module Name:  src
 Committed By: jakllsch
 Date: Sat Feb 26 18:22:59 UTC 2011
 
 Modified Files:
   src/sys/arch/i386/stand/boot: Makefile.boot
 
 Log Message:
 Enable LIBSA_PRINTF_LONGLONG_SUPPORT.
 Useful in any of the cases where we already print a (64-bit) daddr_t.

I'm surprised that doesn't explode the sizes of the boot code.

David

-- 
David Laight: da...@l8s.co.uk


Re: CVS commit: src/sys/kern

2011-02-27 Thread David Holland
On Sun, Feb 27, 2011 at 07:12:16PM -0500, Christos Zoulas wrote:
  don't depend on F_OK being 0.
:
  -   if ((SCARG(uap, flags)  ~(R_OK | W_OK | X_OK)) != 0) {
  +   if ((SCARG(uap, flags)  ~(F_OK | R_OK | W_OK | X_OK)) != 0) {

That doesn't work; if F_OK isn't zero and the user passes 0, we end up
in the kauth assertion again.

mlelstv and I were just (more or less pointlessly) thrashing out
various ways to fix that in chat, but it ends up overcomplicated, so I
suggest reverting the above and instead adding

+   CTASSERT(F_OK == 0);
if ((SCARG(uap, flags)  ~(R_OK | W_OK | X_OK)) != 0) {

so that if in the unlikely event that anyone ever tries to change F_OK
it will then get further attention.

-- 
David A. Holland
dholl...@netbsd.org


Re: CVS commit: src/sys/kern

2011-02-27 Thread Christos Zoulas
In article 20110228005040.ga26...@netbsd.org,
David Holland  dholland-sourcechan...@netbsd.org wrote:
On Sun, Feb 27, 2011 at 07:12:16PM -0500, Christos Zoulas wrote:
  don't depend on F_OK being 0.
:
  -   if ((SCARG(uap, flags)  ~(R_OK | W_OK | X_OK)) != 0) {
  +   if ((SCARG(uap, flags)  ~(F_OK | R_OK | W_OK | X_OK)) != 0) {

That doesn't work; if F_OK isn't zero and the user passes 0, we end up
in the kauth assertion again.

mlelstv and I were just (more or less pointlessly) thrashing out
various ways to fix that in chat, but it ends up overcomplicated, so I
suggest reverting the above and instead adding

+   CTASSERT(F_OK == 0);
if ((SCARG(uap, flags)  ~(R_OK | W_OK | X_OK)) != 0) {

so that if in the unlikely event that anyone ever tries to change F_OK
it will then get further attention.

Sounds good to me.

christos