[Bug 236714] Clang problem with rctl(8)

2019-04-01 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=236714

--- Comment #6 from Mark Johnston  ---
(In reply to Mateusz Guzik from comment #5)
Well, it's fine in the (probably more common) case where the kernel changed a
type from int to bool and userspace applications are not immediately updated to
match.  But I agree that it could cause some unpleasant surprises, and your
diff looks fine to me.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-toolchain@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-toolchain
To unsubscribe, send any mail to "freebsd-toolchain-unsubscr...@freebsd.org"


[Bug 236714] Clang problem with rctl(8)

2019-04-01 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=236714

--- Comment #5 from Mateusz Guzik  ---
(In reply to Mark Johnston from comment #3)

I don't think that's feasible since consumers can pass arbitrary sizes, and
some probably pass more than they intended in a bogus manner where they would
not be prepared to sudden zeroing of the area passed.

Looks like the bug at hand can be easily taken care of with just resizing the
var to bool in the userspace tool. While the previous binary remains broken I
don't think it's a big deal since this is current-only.

that is:
diff --git a/usr.bin/rctl/rctl.c b/usr.bin/rctl/rctl.c
index 74073c13207e..f8b5115a4507 100644
--- a/usr.bin/rctl/rctl.c
+++ b/usr.bin/rctl/rctl.c
@@ -378,8 +378,9 @@ print_rules(char *rules, int hflag, int nflag)
 static void
 enosys(void)
 {
-   int error, racct_enable;
size_t racct_enable_len;
+   int error;
+   bool racct_enable;

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

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-toolchain@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-toolchain
To unsubscribe, send any mail to "freebsd-toolchain-unsubscr...@freebsd.org"