Page MenuHomeFreeBSD

describe flag returned by `cap_getmode`
ClosedPublic

Authored by emaste on Sep 8 2016, 2:37 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 30 2024, 1:51 AM
Unknown Object (File)
Feb 28 2024, 2:23 PM
Unknown Object (File)
Dec 20 2023, 12:18 AM
Unknown Object (File)
Nov 21 2023, 3:04 PM
Unknown Object (File)
Nov 4 2023, 3:43 AM
Unknown Object (File)
Nov 3 2023, 4:32 PM
Unknown Object (File)
Oct 3 2023, 3:39 AM
Unknown Object (File)
Oct 1 2023, 3:38 AM
Subscribers
None

Details

Summary

Previously the flag returned by cap_getmode was not described explicitly in the man page.

Diff Detail

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

Event Timeline

emaste retitled this revision from to describe flag returned by `cap_getmode`.
emaste updated this object.
emaste edited the test plan for this revision. (Show Details)
emaste added reviewers: wblock, allanjude, oshogbo.
emaste added inline comments.
lib/libc/sys/cap_enter.2
87–91 ↗(On Diff #20161)

Alternatively:

The cap_getmode function sets the flag to a non-zero value if the process is in capability mode, or zero if the process is not in capability mode.

lib/libc/sys/cap_enter.2
87–91 ↗(On Diff #20161)

Some of the "if not" logic makes it kind of hard to read ("don't do what Donny Don't doesn't do!"). Maybe rearrange?

.Fn cap_getmode
returns a non-zero value when the process is in capability mode.
A zero value means the process is not in capability mode.

or...

When the process is in capability mode,
.Fn cap_getmode
returns a non-zero value.
A zero value means the process is not in capability mode.
lib/libc/sys/cap_enter.2
87–91 ↗(On Diff #20161)

Note that the flag (passed in the u_int *modep argument) is set to zero/non-zero to indicate if it is in capability mode, not the return value. But I prefer the way you formulated it, indeed.

How does this sound:

When the process is in capability mode,
.Fn cap_getmode
sets the flag to a non-zero value.
A zero value means the process is not in capability mode.

update text based on @wblock feedback

lib/libc/sys/cap_enter.2
88 ↗(On Diff #20232)

Much better. But I still think there should be a comma for a pause after "mode".

This revision was automatically updated to reflect the committed changes.