misc/174910: [patch][regression] sysctl error message includes memory address instead of string

Fabian Keil fk at fabiankeil.de
Wed Jan 2 20:00:00 UTC 2013


>Number:         174910
>Category:       misc
>Synopsis:       [patch][regression] sysctl error message includes memory address instead of string
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jan 02 20:00:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Fabian Keil
>Release:        HEAD
>Organization:
>Environment:
FreeBSD r500.local 10.0-CURRENT FreeBSD 10.0-CURRENT #537 r+6795152: Tue Jan  1 01:38:41 CET 2013     fk at r500.local:/usr/obj/usr/src/sys/ZOEY  amd64

>Description:
Since r244198 the sysctl error message shown when trying to modify read only tunables ends with a memory address instead of the string potentially containing the line number.
>How-To-Repeat:
fk at r500 ~ $sysctl vfs.zfs.zio.exclude_metadata=0
sysctl: oid 'vfs.zfs.zio.exclude_metadata' is a read only tunable0x7fffffffc800

>Fix:
Apply attached patch.

Patch attached with submission follows:

>From d0996d442d063089705dec2fe7e48848b07dd531 Mon Sep 17 00:00:00 2001
From: Fabian Keil <fk at fabiankeil.de>
Date: Wed, 2 Jan 2013 20:18:37 +0100
Subject: [PATCH] Fix sysctl complaint when trying to modify a tunable that is
 read only

Since r244198 the address of the line string (empty, or a line
number in case of -f) was shown instead of the string itself:

fk at r500 ~ $sysctl vfs.zfs.zio.exclude_metadata=0
sysctl: oid 'vfs.zfs.zio.exclude_metadata' is a read only tunable0x7fffffffc820
sysctl: Tunable values are set in /boot/loader.conf
---
 sbin/sysctl/sysctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c
index 3df4f01..d62e52a 100644
--- a/sbin/sysctl/sysctl.c
+++ b/sbin/sysctl/sysctl.c
@@ -266,7 +266,7 @@ parse(const char *string, int lineno)
 
 		if (!(kind & CTLFLAG_WR)) {
 			if (kind & CTLFLAG_TUN) {
-				warnx("oid '%s' is a read only tunable%p", bufp, line);
+				warnx("oid '%s' is a read only tunable%s", bufp, line);
 				warnx("Tunable values are set in /boot/loader.conf");
 			} else
 				warnx("oid '%s' is read only%s", bufp, line);
-- 
1.8.0.3



>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list