Subject: kern/23695: sysctl logsigexit not writable
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <gcw@primenet.com.au>
List: netbsd-bugs
Date: 12/09/2003 10:54:29
>Number:         23695
>Category:       kern
>Synopsis:       sysctl -w kern.logsigexit=1 doesn't work
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Dec 08 23:55:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Geoff C. Wing
>Release:        NetBSD 1.6ZG (2003/12/08)
>Organization:
>Environment:
System: NetBSD g.primenet.com.au 1.6ZG NetBSD 1.6ZG (G) #0: Mon Dec 8 14:07:49 EST 2003 gcw@g.primenet.com.au:/usr/netbsd/src/sys/arch/i386/compile/G i386
Architecture: i386
Machine: i386
>Description:
	% man sysctl | fgrep logsigexit
	    kern.logsigexit                              integer       yes
	% sysctl -w kern.logsigexit=1
	kern.logsigexit: sysctl() failed with Operation not permitted

>How-To-Repeat:
	see above
>Fix:
	This is a guess:

--- sys/kern/init_sysctl.c.org	2003-12-07 21:33:03.000000000 +1100
+++ sys/kern/init_sysctl.c	2003-12-09 10:53:10.000000000 +1100
@@ -410,7 +410,7 @@
 		       CTLTYPE_STRING, "defcorename", NULL,
 		       sysctl_kern_defcorename, 0, defcorename, MAXPATHLEN,
 		       CTL_KERN, KERN_DEFCORENAME, CTL_EOL);
-	sysctl_createv(SYSCTL_PERMANENT,
+	sysctl_createv(SYSCTL_PERMANENT|SYSCTL_READWRITE,
 		       CTLTYPE_INT, "logsigexit", NULL,
 		       NULL, 0, &kern_logsigexit, 0,
 		       CTL_KERN, KERN_LOGSIGEXIT, CTL_EOL);
>Release-Note:
>Audit-Trail:
>Unformatted: