Deleted Added
full compact
kern_priv.c (176903) kern_priv.c (183113)
1/*-
2 * Copyright (c) 2006 nCircle Network Security, Inc.
3 * All rights reserved.
4 *
5 * This software was developed by Robert N. M. Watson for the TrustedBSD
6 * Project under contract to nCircle Network Security, Inc.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 16 unchanged lines hidden (view full) ---

25 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */
29
30#include "opt_mac.h"
31
32#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2006 nCircle Network Security, Inc.
3 * All rights reserved.
4 *
5 * This software was developed by Robert N. M. Watson for the TrustedBSD
6 * Project under contract to nCircle Network Security, Inc.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 16 unchanged lines hidden (view full) ---

25 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */
29
30#include "opt_mac.h"
31
32#include <sys/cdefs.h>
33__FBSDID("$FreeBSD: head/sys/kern/kern_priv.c 176903 2008-03-07 15:27:08Z rwatson $");
33__FBSDID("$FreeBSD: head/sys/kern/kern_priv.c 183113 2008-09-17 15:49:44Z attilio $");
34
35#include <sys/param.h>
36#include <sys/jail.h>
37#include <sys/kernel.h>
38#include <sys/priv.h>
39#include <sys/proc.h>
40#include <sys/sysctl.h>
41#include <sys/systm.h>

--- 86 unchanged lines hidden (view full) ---

128int
129priv_check(struct thread *td, int priv)
130{
131
132 KASSERT(td == curthread, ("priv_check: td != curthread"));
133
134 return (priv_check_cred(td->td_ucred, priv, 0));
135}
34
35#include <sys/param.h>
36#include <sys/jail.h>
37#include <sys/kernel.h>
38#include <sys/priv.h>
39#include <sys/proc.h>
40#include <sys/sysctl.h>
41#include <sys/systm.h>

--- 86 unchanged lines hidden (view full) ---

128int
129priv_check(struct thread *td, int priv)
130{
131
132 KASSERT(td == curthread, ("priv_check: td != curthread"));
133
134 return (priv_check_cred(td->td_ucred, priv, 0));
135}
136
137/*
138 * Historical suser() wrapper functions, which now simply request PRIV_ROOT.
139 * These will be removed in the near future, and exist solely because
140 * the kernel and modules are not yet fully adapted to the new model.
141 */
142int
143suser_cred(struct ucred *cred, int flags)
144{
145
146 return (priv_check_cred(cred, PRIV_ROOT, flags));
147}
148
149int
150suser(struct thread *td)
151{
152
153 KASSERT(td == curthread, ("suser: td != curthread"));
154
155 return (suser_cred(td->td_ucred, 0));
156}