sysv_msg.c (219028) | sysv_msg.c (220388) |
---|---|
1/*- 2 * Implementation of SVID messages 3 * 4 * Author: Daniel Boulet 5 * 6 * Copyright 1993 Daniel Boulet and RTMX Inc. 7 * 8 * This system call was implemented by Daniel Boulet under contract from RTMX. --- 34 unchanged lines hidden (view full) --- 43 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 44 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 45 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 46 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 47 * SUCH DAMAGE. 48 */ 49 50#include <sys/cdefs.h> | 1/*- 2 * Implementation of SVID messages 3 * 4 * Author: Daniel Boulet 5 * 6 * Copyright 1993 Daniel Boulet and RTMX Inc. 7 * 8 * This system call was implemented by Daniel Boulet under contract from RTMX. --- 34 unchanged lines hidden (view full) --- 43 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 44 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 45 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 46 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 47 * SUCH DAMAGE. 48 */ 49 50#include <sys/cdefs.h> |
51__FBSDID("$FreeBSD: head/sys/kern/sysv_msg.c 219028 2011-02-25 10:11:01Z netchild $"); | 51__FBSDID("$FreeBSD: head/sys/kern/sysv_msg.c 220388 2011-04-06 16:59:54Z trasz $"); |
52 53#include "opt_compat.h" 54#include "opt_sysvipc.h" 55 56#include <sys/param.h> 57#include <sys/systm.h> 58#include <sys/sysproto.h> 59#include <sys/kernel.h> --- 401 unchanged lines hidden (view full) --- 461 for (msghdr = msqkptr->u.msg_first; msghdr != NULL; 462 msghdr = msghdr->msg_next) { 463 error = mac_sysvmsq_check_msgrmid(td->td_ucred, msghdr); 464 if (error != 0) 465 goto done2; 466 } 467#endif 468 | 52 53#include "opt_compat.h" 54#include "opt_sysvipc.h" 55 56#include <sys/param.h> 57#include <sys/systm.h> 58#include <sys/sysproto.h> 59#include <sys/kernel.h> --- 401 unchanged lines hidden (view full) --- 461 for (msghdr = msqkptr->u.msg_first; msghdr != NULL; 462 msghdr = msghdr->msg_next) { 463 error = mac_sysvmsq_check_msgrmid(td->td_ucred, msghdr); 464 if (error != 0) 465 goto done2; 466 } 467#endif 468 |
469 crfree(msqkptr->cred); 470 msqkptr->cred = NULL; 471 |
|
469 /* Free the message headers */ 470 msghdr = msqkptr->u.msg_first; 471 while (msghdr != NULL) { 472 struct msg *msghdr_tmp; 473 474 /* Free the segments of each message */ 475 msqkptr->u.msg_cbytes -= msghdr->msg_ts; 476 msqkptr->u.msg_qnum--; --- 138 unchanged lines hidden (view full) --- 615 } 616 DPRINTF(("msqid %d is available\n", msqid)); 617 msqkptr->u.msg_perm.key = key; 618 msqkptr->u.msg_perm.cuid = cred->cr_uid; 619 msqkptr->u.msg_perm.uid = cred->cr_uid; 620 msqkptr->u.msg_perm.cgid = cred->cr_gid; 621 msqkptr->u.msg_perm.gid = cred->cr_gid; 622 msqkptr->u.msg_perm.mode = (msgflg & 0777); | 472 /* Free the message headers */ 473 msghdr = msqkptr->u.msg_first; 474 while (msghdr != NULL) { 475 struct msg *msghdr_tmp; 476 477 /* Free the segments of each message */ 478 msqkptr->u.msg_cbytes -= msghdr->msg_ts; 479 msqkptr->u.msg_qnum--; --- 138 unchanged lines hidden (view full) --- 618 } 619 DPRINTF(("msqid %d is available\n", msqid)); 620 msqkptr->u.msg_perm.key = key; 621 msqkptr->u.msg_perm.cuid = cred->cr_uid; 622 msqkptr->u.msg_perm.uid = cred->cr_uid; 623 msqkptr->u.msg_perm.cgid = cred->cr_gid; 624 msqkptr->u.msg_perm.gid = cred->cr_gid; 625 msqkptr->u.msg_perm.mode = (msgflg & 0777); |
626 crhold(cred); 627 msqkptr->cred = cred; |
|
623 /* Make sure that the returned msqid is unique */ 624 msqkptr->u.msg_perm.seq = (msqkptr->u.msg_perm.seq + 1) & 0x7fff; 625 msqkptr->u.msg_first = NULL; 626 msqkptr->u.msg_last = NULL; 627 msqkptr->u.msg_cbytes = 0; 628 msqkptr->u.msg_qnum = 0; 629 msqkptr->u.msg_qbytes = msginfo.msgmnb; 630 msqkptr->u.msg_lspid = 0; --- 911 unchanged lines hidden --- | 628 /* Make sure that the returned msqid is unique */ 629 msqkptr->u.msg_perm.seq = (msqkptr->u.msg_perm.seq + 1) & 0x7fff; 630 msqkptr->u.msg_first = NULL; 631 msqkptr->u.msg_last = NULL; 632 msqkptr->u.msg_cbytes = 0; 633 msqkptr->u.msg_qnum = 0; 634 msqkptr->u.msg_qbytes = msginfo.msgmnb; 635 msqkptr->u.msg_lspid = 0; --- 911 unchanged lines hidden --- |