cap_sysctl.3: Fix bugs in the example
- Correct the type of the sysctl value. - Initialize the oldsize parameter to cap_sysctlbyname() MFC after: 1 week Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
48be5b976e
commit
44bbda649d
@ -131,8 +131,8 @@ capability to get the value of
|
|||||||
cap_channel_t *capcas, *capsysctl;
|
cap_channel_t *capcas, *capsysctl;
|
||||||
const char *name = "kern.trap_enotcap";
|
const char *name = "kern.trap_enotcap";
|
||||||
void *limit;
|
void *limit;
|
||||||
int value;
|
|
||||||
size_t size;
|
size_t size;
|
||||||
|
bool value;
|
||||||
|
|
||||||
/* Open capability to Casper. */
|
/* Open capability to Casper. */
|
||||||
capcas = cap_init();
|
capcas = cap_init();
|
||||||
@ -160,6 +160,7 @@ if (cap_sysctl_limit(limit) < 0)
|
|||||||
err(1, "Unable to set limits");
|
err(1, "Unable to set limits");
|
||||||
|
|
||||||
/* Fetch value. */
|
/* Fetch value. */
|
||||||
|
size = sizeof(value);
|
||||||
if (cap_sysctlbyname(capsysctl, name, &value, &size, NULL, 0) < 0)
|
if (cap_sysctlbyname(capsysctl, name, &value, &size, NULL, 0) < 0)
|
||||||
err(1, "Unable to get value of sysctl");
|
err(1, "Unable to get value of sysctl");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user