sysv_msg.c (34961) | sysv_msg.c (43426) |
---|---|
1/* $Id: sysv_msg.c,v 1.17 1997/11/06 19:29:24 phk Exp $ */ | 1/* $Id: sysv_msg.c,v 1.18 1998/03/30 09:50:35 phk Exp $ */ |
2 3/* 4 * Implementation of SVID messages 5 * 6 * Author: Daniel Boulet 7 * 8 * Copyright 1993 Daniel Boulet and RTMX Inc. 9 * --- 237 unchanged lines hidden (view full) --- 247 248 break; 249 250 case IPC_SET: 251 if ((eval = ipcperm(cred, &msqptr->msg_perm, IPC_M))) 252 return(eval); 253 if ((eval = copyin(user_msqptr, &msqbuf, sizeof(msqbuf))) != 0) 254 return(eval); | 2 3/* 4 * Implementation of SVID messages 5 * 6 * Author: Daniel Boulet 7 * 8 * Copyright 1993 Daniel Boulet and RTMX Inc. 9 * --- 237 unchanged lines hidden (view full) --- 247 248 break; 249 250 case IPC_SET: 251 if ((eval = ipcperm(cred, &msqptr->msg_perm, IPC_M))) 252 return(eval); 253 if ((eval = copyin(user_msqptr, &msqbuf, sizeof(msqbuf))) != 0) 254 return(eval); |
255 if (msqbuf.msg_qbytes > msqptr->msg_qbytes && cred->cr_uid != 0) 256 return(EPERM); | 255 if (msqbuf.msg_qbytes > msqptr->msg_qbytes) { 256 eval = suser(cred, &p->p_acflag); 257 if (eval) 258 return(eval); 259 } |
257 if (msqbuf.msg_qbytes > msginfo.msgmnb) { 258#ifdef MSG_DEBUG_OK 259 printf("can't increase msg_qbytes beyond %d (truncating)\n", 260 msginfo.msgmnb); 261#endif 262 msqbuf.msg_qbytes = msginfo.msgmnb; /* silently restrict qbytes to system limit */ 263 } 264 if (msqbuf.msg_qbytes == 0) { --- 763 unchanged lines hidden --- | 260 if (msqbuf.msg_qbytes > msginfo.msgmnb) { 261#ifdef MSG_DEBUG_OK 262 printf("can't increase msg_qbytes beyond %d (truncating)\n", 263 msginfo.msgmnb); 264#endif 265 msqbuf.msg_qbytes = msginfo.msgmnb; /* silently restrict qbytes to system limit */ 266 } 267 if (msqbuf.msg_qbytes == 0) { --- 763 unchanged lines hidden --- |