secflags.c revision d2a70789f056fc6c9ce3ab047b52126d80b0e3da
/*
* This file and its contents are supplied under the terms of the
* Common Development and Distribution License ("CDDL"), version 1.0.
* You may only use this file in accordance with the terms of version
* 1.0 of the CDDL.
*
* A full copy of the text of the CDDL should have accompanied this
* source. A copy of the CDDL is also available via the Internet at
*/
/* Copyright 2015, Richard Lowe. */
#include <sys/secflags.h>
#if defined(_KERNEL)
#else
#include "lint.h" /* libc header */
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
#endif
{
return (1 << secflag);
}
{
}
void
{
}
void
{
}
{
return (flags == 0);
}
void
{
*flags = 0;
}
void
{
*flags = PROC_SEC_MASK;
}
void
{
}
{
return (!(a & ~b));
}
{
return (secflags_issubset(b, a));
}
{
return (a & b);
}
void
{
*a |= *b;
}
void
{
*a &= ~*b;
}
{
if (delta->psd_ass_active) {
/*
* If there's a bit in lower not in args, or a bit args not in
* upper
*/
return (B_FALSE);
}
return (B_FALSE);
} else {
/* If we're adding a bit not in upper */
return (B_FALSE);
}
}
/* If we're removing a bit that's in lower */
return (B_FALSE);
}
}
return (B_FALSE);
}
return (B_TRUE);
}
{
return (B_FALSE);
return (B_FALSE);
return (B_FALSE);
return (B_FALSE);
return (B_TRUE);
}
void
{
}
static struct flagdesc {
const char *name;
} flagdescs[] = {
{ PROC_SEC_ASLR, "aslr" },
{ PROC_SEC_FORBIDNULLMAP, "forbidnullmap" },
{ PROC_SEC_NOEXECSTACK, "noexecstack" },
{ 0x0, NULL }
};
{
return (B_TRUE);
}
}
return (B_FALSE);
}
const char *
{
}
return (NULL);
}
void
{
if (buflen >= 1)
buf[0] = '\0';
if (flags == 0) {
return;
}
if (buf[0] != '\0')
}
}
if (flags != 0) { /* unknown flags */
if (buf[0] != '\0')
}
}