make sysctls kern.{bootfile,conftxt} read-only
MFC after: 1 month
This commit is contained in:
parent
c68dd1cf0f
commit
d06cadae1e
@ -141,7 +141,7 @@ SYSCTL_INT(_kern, KERN_SAVED_IDS, saved_ids, CTLFLAG_RD|CTLFLAG_CAPRD,
|
||||
|
||||
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, securelevel,
|
||||
/* 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
|
||||
|
Loading…
x
Reference in New Issue
Block a user