d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe * This file and its contents are supplied under the terms of the
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe * Common Development and Distribution License ("CDDL"), version 1.0.
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe * You may only use this file in accordance with the terms of version
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe * 1.0 of the CDDL.
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe * A full copy of the text of the CDDL should have accompanied this
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe * source. A copy of the CDDL is also available via the Internet at
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe/* Copyright 2015, Richard Lowe. */
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowesecflags_apply_delta(secflagset_t *set, const secflagdelta_t *delta)
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe if (secpolicy_psecflags(CRED(), p, curproc) != 0) {
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe if (!psecflags_validate_delta(&p->p_secflags, args->delta)) {
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe * Add any flag now in the lower that is not in the inheritable.
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe secflags_union(&p->p_secflags.psf_inherit, &p->p_secflags.psf_lower);
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowepsecflags(procset_t *psp, psecflagwhich_t which, secflagdelta_t *ap)
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe /* Can never change the effective flags */
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe if (copyin(psp, &procset, sizeof (procset)) != 0)
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe if (copyin(ap, &args, sizeof (secflagdelta_t)) != 0)
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe /* secflags are per-process, procset must be in terms of processes */