Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Fix sysctl handling for raise-only variables. This ...



details:   https://anonhg.NetBSD.org/src/rev/2d965bae33e2
branches:  trunk
changeset: 582063:2d965bae33e2
user:      elad <elad%NetBSD.org@localhost>
date:      Wed Jun 15 16:58:31 2005 +0000

description:
Fix sysctl handling for raise-only variables. This affected the veriexec
node entirely. Reported by Nino Dehne.

diffstat:

 sys/kern/init_sysctl.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (38 lines):

diff -r 521e8b1a7497 -r 2d965bae33e2 sys/kern/init_sysctl.c
--- a/sys/kern/init_sysctl.c    Wed Jun 15 15:16:23 2005 +0000
+++ b/sys/kern/init_sysctl.c    Wed Jun 15 16:58:31 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: init_sysctl.c,v 1.43 2005/06/09 02:19:59 atatat Exp $ */
+/*     $NetBSD: init_sysctl.c,v 1.44 2005/06/15 16:58:31 elad Exp $ */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: init_sysctl.c,v 1.43 2005/06/09 02:19:59 atatat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: init_sysctl.c,v 1.44 2005/06/15 16:58:31 elad Exp $");
 
 #include "opt_sysv.h"
 #include "opt_multiprocessor.h"
@@ -2420,9 +2420,6 @@
                return (EINVAL);
        }
 
-       if (raise_only && (*var != 0) && (securelevel > 0))
-               return (EPERM);
-
        newval = *var;
 
        node.sysctl_data = &newval;
@@ -2431,6 +2428,9 @@
                return (error);
        }
 
+       if (raise_only && (newval < *var))
+               return (EPERM);
+
        *var = newval;
 
        return (error);



Home | Main Index | Thread Index | Old Index