Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Dec 2012 23:09:56 +0000 (UTC)
From:      Alfred Perlstein <alfred@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r244098 - head/sys/kern
Message-ID:  <201212102309.qBAN9uCf033959@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: alfred
Date: Mon Dec 10 23:09:55 2012
New Revision: 244098
URL: http://svnweb.freebsd.org/changeset/base/244098

Log:
  make sysctls kern.{bootfile,conftxt} read-only
  
  MFC after:	1 month

Modified:
  head/sys/kern/kern_mib.c

Modified: head/sys/kern/kern_mib.c
==============================================================================
--- head/sys/kern/kern_mib.c	Mon Dec 10 21:18:02 2012	(r244097)
+++ head/sys/kern/kern_mib.c	Mon Dec 10 23:09:55 2012	(r244098)
@@ -141,7 +141,7 @@ SYSCTL_INT(_kern, KERN_SAVED_IDS, saved_
 
 char kernelname[MAXPATHLEN] = "/kernel";	/* XXX bloat */
 
-SYSCTL_STRING(_kern, KERN_BOOTFILE, bootfile, CTLFLAG_RW,
+SYSCTL_STRING(_kern, KERN_BOOTFILE, bootfile, CTLFLAG_RD,
     kernelname, sizeof kernelname, "Name of kernel file booted");
 
 SYSCTL_INT(_hw, HW_NCPU, ncpu, CTLFLAG_RD|CTLFLAG_CAPRD,
@@ -377,15 +377,8 @@ SYSCTL_PROC(_kern, KERN_SECURELVL, secur
 /* Actual kernel configuration options. */
 extern char kernconfstring[];
 
-static int
-sysctl_kern_config(SYSCTL_HANDLER_ARGS)
-{
-	return (sysctl_handle_string(oidp, kernconfstring,
-	    strlen(kernconfstring), req));
-}
-
-SYSCTL_PROC(_kern, OID_AUTO, conftxt, CTLTYPE_STRING|CTLFLAG_RW, 
-    0, 0, sysctl_kern_config, "", "Kernel configuration file");
+SYSCTL_STRING(_kern, OID_AUTO, conftxt, CTLFLAG_RD, kernconfstring, 0,
+    "Kernel configuration file");
 #endif
 
 static int



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201212102309.qBAN9uCf033959>