[Bug 236714] Clang problem with rctl(8)

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Fri Mar 22 12:16:12 UTC 2019


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=236714

            Bug ID: 236714
           Summary: Clang problem with rctl(8)
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: bugs at FreeBSD.org
          Reporter: trasz at FreeBSD.org

I've stumbled upon something that seems to me to be a miscompilation issue in
rctl(8).  Basically, this code in usr.bin/rctl/rctl.c:

        racct_enable_len = sizeof(racct_enable);
        error = sysctlbyname("kern.racct.enable",
            &racct_enable, &racct_enable_len, NULL, 0);

        if (error != 0) {
                if (errno == ENOENT)
                        errx(1, "RACCT/RCTL support not present in kernel; see
rctl(8) for details");

                err(1, "sysctlbyname");
        }

        if (racct_enable == 0)
                errx(1, "RACCT/RCTL present, but disabled; enable using
kern.racct.enable=1 tunable");

Doesn't work as expected unless the racct_enable is initialized before calling
sysctlbyname(3).  Without this change:

% doas rctl
rctl: failed to show rules for '::': Function not implemented

With the change:

% doas rctl
rctl: RACCT/RCTL present, but disabled; enable using kern.racct.enable=1
tunable

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list