sysv_ipc.c (170587) | sysv_ipc.c (194910) |
---|---|
1/* $NetBSD: sysv_ipc.c,v 1.7 1994/06/29 06:33:11 cgd Exp $ */ 2/*- 3 * Copyright (c) 1994 Herb Peyerl <hpeyerl@novatel.ca> 4 * Copyright (c) 2006 nCircle Network Security, Inc. 5 * All rights reserved. 6 * 7 * This software was developed by Robert N. M. Watson for the TrustedBSD 8 * Project under contract to nCircle Network Security, Inc. --- 20 unchanged lines hidden (view full) --- 29 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 30 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 31 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 33 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 */ 35 36#include <sys/cdefs.h> | 1/* $NetBSD: sysv_ipc.c,v 1.7 1994/06/29 06:33:11 cgd Exp $ */ 2/*- 3 * Copyright (c) 1994 Herb Peyerl <hpeyerl@novatel.ca> 4 * Copyright (c) 2006 nCircle Network Security, Inc. 5 * All rights reserved. 6 * 7 * This software was developed by Robert N. M. Watson for the TrustedBSD 8 * Project under contract to nCircle Network Security, Inc. --- 20 unchanged lines hidden (view full) --- 29 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 30 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 31 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 33 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 */ 35 36#include <sys/cdefs.h> |
37__FBSDID("$FreeBSD: head/sys/kern/sysv_ipc.c 170587 2007-06-12 00:12:01Z rwatson $"); | 37__FBSDID("$FreeBSD: head/sys/kern/sysv_ipc.c 194910 2009-06-24 21:10:52Z jhb $"); |
38 | 38 |
39#include "opt_compat.h" |
|
39#include "opt_sysvipc.h" 40 41#include <sys/param.h> 42#include <sys/systm.h> 43#include <sys/sem.h> 44#include <sys/shm.h> 45#include <sys/ipc.h> 46#include <sys/priv.h> --- 95 unchanged lines hidden (view full) --- 142 priv_granted |= IPC_W; 143 } 144 145 if (((dac_granted | priv_granted) & acc_mode) == acc_mode) 146 return (0); 147 else 148 return (EACCES); 149} | 40#include "opt_sysvipc.h" 41 42#include <sys/param.h> 43#include <sys/systm.h> 44#include <sys/sem.h> 45#include <sys/shm.h> 46#include <sys/ipc.h> 47#include <sys/priv.h> --- 95 unchanged lines hidden (view full) --- 143 priv_granted |= IPC_W; 144 } 145 146 if (((dac_granted | priv_granted) & acc_mode) == acc_mode) 147 return (0); 148 else 149 return (EACCES); 150} |
151 152#if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \ 153 defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7) 154void 155ipcperm_old2new(struct ipc_perm_old *old, struct ipc_perm *new) 156{ 157 158 new->cuid = old->cuid; 159 new->cgid = old->cgid; 160 new->uid = old->uid; 161 new->gid = old->gid; 162 new->mode = old->mode; 163 new->seq = old->seq; 164 new->key = old->key; 165} 166 167void 168ipcperm_new2old(struct ipc_perm *new, struct ipc_perm_old *old) 169{ 170 171 /* XXX: How to handle ID's > USHORT_MAX? */ 172 old->cuid = new->cuid; 173 old->cgid = new->cgid; 174 old->uid = new->uid; 175 old->gid = new->gid; 176 old->mode = new->mode; 177 old->seq = new->seq; 178 old->key = new->key; 179} 180#endif |
|