Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Mar 2019 12:16:09 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 236714] Clang problem with rctl(8)
Message-ID:  <bug-236714-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D236714

            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@FreeBSD.org
          Reporter: trasz@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 =3D sizeof(racct_enable);
        error =3D sysctlbyname("kern.racct.enable",
            &racct_enable, &racct_enable_len, NULL, 0);

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

                err(1, "sysctlbyname");
        }

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

Doesn't work as expected unless the racct_enable is initialized before call=
ing
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=3D1
tunable

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-236714-227>