kern_priv.c (b916b56b5a1ecbd0c6ed3c4abf17187620567a0e) kern_priv.c (cecd8edba5cf4746e2c828ebc20bc71baa7d202a)
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

--- 119 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}
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

--- 119 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}