Summary: | sysctl.name (0.1) false positive | ||||||
---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | Alfonso S. Siciliano <asiciliano> | ||||
Component: | kern | Assignee: | freebsd-bugs (Nobody) <bugs> | ||||
Status: | Closed Not A Bug | ||||||
Severity: | Affects Only Me | CC: | markj | ||||
Priority: | --- | ||||||
Version: | CURRENT | ||||||
Hardware: | Any | ||||||
OS: | Any | ||||||
Attachments: |
|
New review D20205 with a solution The sysctl.entryname node of the <sysutils/sysctlinfo-kmod> port meets my needs: it return -1 if a node doens't exist. |
Created attachment 204249 [details] file to reproduce the problem The magical "sysctl.name" (0.1), implemented in kern_sysctl.c, gets the 'string name' from the 'int id' of a node, It returns 0 (false positive) and builds a fake name for a non-existent OID. The problem is reproducible by the attached file 'bad_name.c'. Question: Is it a feature? (this code is 20-years-old) Others OIDs sysctl.{oiddesc|oidfmt|oidlabel} return an error for a non-existent node. I have a solution, but I would be sure it is a problem before to create a diff on review.freebsd.org. Regards, Alfonso