From nobody@FreeBSD.org  Wed Jan  2 19:51:49 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
	by hub.freebsd.org (Postfix) with ESMTP id 8F74AE33
	for <freebsd-gnats-submit@FreeBSD.org>; Wed,  2 Jan 2013 19:51:49 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 6210BBF
	for <freebsd-gnats-submit@FreeBSD.org>; Wed,  2 Jan 2013 19:51:49 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.5/8.14.5) with ESMTP id r02JpmTx099076
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 2 Jan 2013 19:51:48 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.5/8.14.5/Submit) id r02Jpm2s099069;
	Wed, 2 Jan 2013 19:51:48 GMT
	(envelope-from nobody)
Message-Id: <201301021951.r02Jpm2s099069@red.freebsd.org>
Date: Wed, 2 Jan 2013 19:51:48 GMT
From: Fabian Keil <fk@fabiankeil.de>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch][regression] sysctl error message includes memory address instead of string
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         174910
>Category:       bin
>Synopsis:       [patch][regression] sysctl error message includes memory address instead of string
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    delphij
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jan 02 20:00:00 UTC 2013
>Closed-Date:    Sun Jan 13 04:29:03 UTC 2013
>Last-Modified:  Sun Jan 13 04:30:00 UTC 2013
>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@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@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@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@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:
Responsible-Changed-From-To: freebsd-bugs->delphij 
Responsible-Changed-By: delphij 
Responsible-Changed-When: Sun Jan 13 04:21:50 UTC 2013 
Responsible-Changed-Why:  
My fault. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=174910 
State-Changed-From-To: open->closed 
State-Changed-By: delphij 
State-Changed-When: Sun Jan 13 04:28:52 UTC 2013 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=174910 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: misc/174910: commit references a PR
Date: Sun, 13 Jan 2013 04:28:53 +0000 (UTC)

 Author: delphij
 Date: Sun Jan 13 04:28:44 2013
 New Revision: 245361
 URL: http://svnweb.freebsd.org/changeset/base/245361
 
 Log:
   Use the right format string for line buffer.
   
   PR:		bin/174910
   Submitted by:	Fabian Keil <fk fabiankeil.de>
 
 Modified:
   head/sbin/sysctl/sysctl.c
 
 Modified: head/sbin/sysctl/sysctl.c
 ==============================================================================
 --- head/sbin/sysctl/sysctl.c	Sun Jan 13 04:14:46 2013	(r245360)
 +++ head/sbin/sysctl/sysctl.c	Sun Jan 13 04:28:44 2013	(r245361)
 @@ -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);
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
>Unformatted:
