Date: Wed, 1 Nov 2000 08:34:17 -0800 (PST) From: ryan.rempel@utoronto.ca To: freebsd-gnats-submit@FreeBSD.org Subject: bin/22482: The sysctl (8) command uses strtol on input for unsigned ints Message-ID: <20001101163417.3D1C637B4C5@hub.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 22482
>Category: bin
>Synopsis: The sysctl (8) command uses strtol on input for unsigned ints
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Wed Nov 01 08:40:01 PST 2000
>Closed-Date:
>Last-Modified:
>Originator: Ryan Rempel
>Release: None (well, Darwin)
>Organization:
>Environment:
Not relevant, but here it is anyway. Darwin rempel.homeip.net 1.2 Darwin Kernel Version 1.2: Wed Aug 30 23:32:53 PDT 2000; root:xnu/xnu-103.obj~1/RELEASE_PPC Power Macintosh powerpc
>Description:
The freeBSD sysctl (8) command has been updated to display sysctl values as unsigned ints when the oid format is "IU". However, when using sysctl (8) to set sysctl values, strtol is used on the input, even for oids with format "IU". This means that values higher than 0x7FFFFFFF are clamped.
>How-To-Repeat:
Use sysctl to set an unsigned int value higher than 0x7FFFFFFF. For instance:
sysctl -w kern.hostid=3456789012
>Fix:
Here is a patch (I wrote) to sysctl (8) that fixes the problem.
begin 644 sysctl.diff
M26YD97@Z('-Y<V-T;"YC"CT]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]
M/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T*4D-3(&9I
M;&4Z("]H;VUE+VYC=G,O<W)C+W-B:6XO<WES8W1L+W-Y<V-T;"YC+'8*<F5T
M<FEE=FEN9R!R979I<VEO;B`Q+C(Y"F1I9F8@+74@+60@+6(@+7<@+7(Q+C(Y
M('-Y<V-T;"YC"BTM+2!S>7-C=&PN8PDR,#`P+S$P+S(S(#(Q.C`T.C$X"3$N
M,CD**RL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"`P*3L*
M(`D)"0EN97=V86P@/2`F:6YT=F%L.PH@"0D)"6YE=W-I>F4@/2!S:7IE;V8@
M:6YT=F%L.PHM"0D)"6)R96%K.PHK"0D)"7T*(`D)"0EB<F5A:SL*(`D)"6-A
?<V4@0U1,5%E015]35%))3D<Z"B`)"0D)8G)E86L["@EB
`
end
>Release-Note:
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20001101163417.3D1C637B4C5>
