Bug 22482 - The sysctl (8) command uses strtol on input for unsigned ints
Summary: The sysctl (8) command uses strtol on input for unsigned ints
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: Jim Pirzyk
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2000-11-01 16:40 UTC by ryan.rempel
Modified: 2001-06-25 19:36 UTC (History)
0 users

See Also:


Attachments
sysctl.diff (1.58 KB, patch)
2000-11-01 16:40 UTC, ryan.rempel
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description ryan.rempel 2000-11-01 16:40:01 UTC
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.

Fix: Here is a patch (I wrote) to sysctl (8) that fixes the problem.
How-To-Repeat: Use sysctl to set an unsigned int value higher than 0x7FFFFFFF. For instance:

sysctl -w kern.hostid=3456789012
Comment 1 dd freebsd_committer freebsd_triage 2001-06-23 06:25:40 UTC
Responsible Changed
From-To: freebsd-bugs->pirzyk

I believe Jim recently fixed this in -current.
Comment 2 Jim Pirzyk freebsd_committer freebsd_triage 2001-06-25 19:35:59 UTC
State Changed
From-To: open->closed

sysctl(8) has been fixed in -current, the fixes will be MFC'ed in 
about 1 month.