Bug 22482

Summary: The sysctl (8) command uses strtol on input for unsigned ints
Product: Base System Reporter: ryan.rempel <ryan.rempel>
Component: binAssignee: Jim Pirzyk <pirzyk>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
sysctl.diff none

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.