Date: Wed, 2 Jan 2013 19:51:48 GMT From: Fabian Keil <fk@fabiankeil.de> To: freebsd-gnats-submit@FreeBSD.org Subject: misc/174910: [patch][regression] sysctl error message includes memory address instead of string Message-ID: <201301021951.r02Jpm2s099069@red.freebsd.org> Resent-Message-ID: <201301022000.r02K000o067906@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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@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: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201301021951.r02Jpm2s099069>