Page MenuHomeFreeBSD

Bring back the variable size and set it properly on sysctl(3).
ClosedPublic

Authored by araujo on Jun 4 2015, 10:17 AM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 10 2026, 3:39 PM
Unknown Object (File)
Dec 23 2025, 2:26 PM
Unknown Object (File)
Nov 22 2025, 2:19 PM
Unknown Object (File)
Nov 21 2025, 2:00 AM
Unknown Object (File)
Nov 21 2025, 1:58 AM
Unknown Object (File)
Nov 21 2025, 1:55 AM
Unknown Object (File)
Nov 21 2025, 1:55 AM
Unknown Object (File)
Nov 21 2025, 1:55 AM
Subscribers

Details

Summary
  1. Bring back the variable size that is used on sysctl(3).

To set a new value, newp is set to point to a buffer of length newlen
from which the requested value is to be taken. If a new value is not to
be set, newp should be set to NULL and newlen set to 0.

Spotted by: kib and ngie.

  1. Add missing prototypes.
  2. Initialize variable jid to 0.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

araujo retitled this revision from to Bring back the variable size and set it properly on sysctl(3)..
araujo updated this object.
araujo edited the test plan for this revision. (Show Details)
araujo added reviewers: rodrigc, kib, ngie.

Patch contains unrelevant chunks, I did not looked at them.

lib/libugidfw/ugidfw.c
1236 ↗(On Diff #5939)

Why do you need to restore the size variable ? sizeof(rule) as the last argument seems to be enough.

Was this tested ?

lib/libugidfw/ugidfw.c
1236 ↗(On Diff #5939)

It was tested! I did restore the variable size to keep the consistency with the rest of the code that does it in the same way.

Guys, any additional comments?

In D2733#52424, @araujo wrote:

Guys, any additional comments?

Did you noted the complain about unrelated changes in the patch ?

That said, IMO restoring the variable is useless, together with the var use for new size in other places. A follow-up patch could clear that places to use sizeof(rule) as well.

In D2733#52425, @kib wrote:
In D2733#52424, @araujo wrote:

Guys, any additional comments?

Did you noted the complain about unrelated changes in the patch ?

That said, IMO restoring the variable is useless, together with the var use for new size in other places. A follow-up patch could clear that places to use sizeof(rule) as well.

I agree with kib@. If the variable's genuinely unused it should be removed or replaced with the equivalent value, especially if it's read-only like size is.

araujo edited edge metadata.

Remove the variable size and use sizeof inside the sysctl(3).

ngie edited edge metadata.

Please update the commit message -- code change LGTM!

This revision is now accepted and ready to land.Jun 9 2015, 7:03 AM

Patch still contains unrelated changes.

In D2733#52804, @kib wrote:

Patch still contains unrelated changes.

Sorry, but did you read the summary? Do you want me open two reviews with two different patches one for prototype the functions missed and another one for the 'size' variable?

I want the 'size' changes be a single commit without unrelated parts.

I do not have confidence in the ugidfw.h changes. The functions may be an internal helpers, which should not be exported. But this must be investigated separately, I do not see why unrelated issues are mixed.

araujo edited edge metadata.

Make this review specific for the variable 'size' as @kib requested.

This revision now requires review to proceed.Jun 9 2015, 12:56 PM
In D2733#52814, @kib wrote:

I want the 'size' changes be a single commit without unrelated parts.

I do not have confidence in the ugidfw.h changes. The functions may be an internal helpers, which should not be exported. But this must be investigated separately, I do not see why unrelated issues are mixed.

@kib for the another change in ugidfw.h, do you want me add you as a reviewer?

kib edited edge metadata.

WRT the ugidfw.h change, I can take a look.

This revision is now accepted and ready to land.Jun 9 2015, 4:21 PM