Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/secmodel/securelevel Compare against initproc, not pid 1...
details: https://anonhg.NetBSD.org/src/rev/828760726119
branches: trunk
changeset: 747957:828760726119
user: elad <elad%NetBSD.org@localhost>
date: Wed Oct 07 01:06:57 2009 +0000
description:
Compare against initproc, not pid 1, to check if it's init (unify).
diffstat:
sys/secmodel/securelevel/secmodel_securelevel.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diffs (38 lines):
diff -r 66ad76960aaf -r 828760726119 sys/secmodel/securelevel/secmodel_securelevel.c
--- a/sys/secmodel/securelevel/secmodel_securelevel.c Tue Oct 06 21:39:58 2009 +0000
+++ b/sys/secmodel/securelevel/secmodel_securelevel.c Wed Oct 07 01:06:57 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: secmodel_securelevel.c,v 1.19 2009/10/06 05:03:58 elad Exp $ */
+/* $NetBSD: secmodel_securelevel.c,v 1.20 2009/10/07 01:06:57 elad Exp $ */
/*-
* Copyright (c) 2006 Elad Efrat <elad%NetBSD.org@localhost>
* All rights reserved.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: secmodel_securelevel.c,v 1.19 2009/10/06 05:03:58 elad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: secmodel_securelevel.c,v 1.20 2009/10/07 01:06:57 elad Exp $");
#ifdef _KERNEL_OPT
#include "opt_insecure.h"
@@ -66,8 +66,8 @@
static struct sysctllog *securelevel_sysctl_log;
/*
- * sysctl helper routine for securelevel. ensures that the value
- * only rises unless the caller has pid 1 (assumed to be init).
+ * Sysctl helper routine for securelevel. Ensures that the value only rises
+ * unless the caller is init.
*/
int
secmodel_securelevel_sysctl(SYSCTLFN_ARGS)
@@ -82,7 +82,7 @@
if (error || newp == NULL)
return (error);
- if (newsecurelevel < securelevel && l && l->l_proc->p_pid != 1)
+ if ((newsecurelevel < securelevel) && (l->l_proc != initproc))
return (EPERM);
securelevel = newsecurelevel;
Home |
Main Index |
Thread Index |
Old Index