summaryrefslogtreecommitdiffstats
path: root/sys/kern/sysv_msg.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2007-10-24 19:04:04 +0000
committerrwatson <rwatson@FreeBSD.org>2007-10-24 19:04:04 +0000
commit60570a92bf794d255e5f8ed235b49c553776ad92 (patch)
treefea282db79628eed98808fd38cc46445b2f97ca5 /sys/kern/sysv_msg.c
parent7781c2181af1113baab38322a55a90b5469cba03 (diff)
downloadFreeBSD-src-60570a92bf794d255e5f8ed235b49c553776ad92.zip
FreeBSD-src-60570a92bf794d255e5f8ed235b49c553776ad92.tar.gz
Merge first in a series of TrustedBSD MAC Framework KPI changes
from Mac OS X Leopard--rationalize naming for entry points to the following general forms: mac_<object>_<method/action> mac_<object>_check_<method/action> The previous naming scheme was inconsistent and mostly reversed from the new scheme. Also, make object types more consistent and remove spaces from object types that contain multiple parts ("posix_sem" -> "posixsem") to make mechanical parsing easier. Introduce a new "netinet" object type for certain IPv4/IPv6-related methods. Also simplify, slightly, some entry point names. All MAC policy modules will need to be recompiled, and modules not updates as part of this commit will need to be modified to conform to the new KPI. Sponsored by: SPARTA (original patches against Mac OS X) Obtained from: TrustedBSD Project, Apple Computer
Diffstat (limited to 'sys/kern/sysv_msg.c')
-rw-r--r--sys/kern/sysv_msg.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/sys/kern/sysv_msg.c b/sys/kern/sysv_msg.c
index bd5ca90..fe92186 100644
--- a/sys/kern/sysv_msg.c
+++ b/sys/kern/sysv_msg.c
@@ -224,7 +224,7 @@ msginit()
msghdrs[i-1].msg_next = &msghdrs[i];
msghdrs[i].msg_next = NULL;
#ifdef MAC
- mac_init_sysv_msgmsg(&msghdrs[i]);
+ mac_sysvmsg_init(&msghdrs[i]);
#endif
}
free_msghdrs = &msghdrs[0];
@@ -237,7 +237,7 @@ msginit()
msqids[i].u.msg_perm.seq = 0; /* reset to a known value */
msqids[i].u.msg_perm.mode = 0;
#ifdef MAC
- mac_init_sysv_msgqueue(&msqids[i]);
+ mac_sysvmsq_init(&msqids[i]);
#endif
}
mtx_init(&msq_mtx, "msq", NULL, MTX_DEF);
@@ -269,9 +269,9 @@ msgunload()
#ifdef MAC
for (i = 0; i < msginfo.msgtql; i++)
- mac_destroy_sysv_msgmsg(&msghdrs[i]);
+ mac_sysvmsg_destroy(&msghdrs[i]);
for (msqid = 0; msqid < msginfo.msgmni; msqid++)
- mac_destroy_sysv_msgqueue(&msqids[msqid]);
+ mac_sysvmsq_destroy(&msqids[msqid]);
#endif
free(msgpool, M_MSG);
free(msgmaps, M_MSG);
@@ -369,7 +369,7 @@ msg_freehdr(msghdr)
msghdr->msg_next = free_msghdrs;
free_msghdrs = msghdr;
#ifdef MAC
- mac_cleanup_sysv_msgmsg(msghdr);
+ mac_sysvmsg_cleanup(msghdr);
#endif
}
@@ -435,7 +435,7 @@ kern_msgctl(td, msqid, cmd, msqbuf)
goto done2;
}
#ifdef MAC
- error = mac_check_sysv_msqctl(td->td_ucred, msqkptr, cmd);
+ error = mac_sysvmsq_check_msqctl(td->td_ucred, msqkptr, cmd);
if (error != 0)
goto done2;
#endif
@@ -463,7 +463,7 @@ kern_msgctl(td, msqid, cmd, msqbuf)
*/
for (msghdr = msqkptr->u.msg_first; msghdr != NULL;
msghdr = msghdr->msg_next) {
- error = mac_check_sysv_msgrmid(td->td_ucred, msghdr);
+ error = mac_sysvmsq_check_msgrmid(td->td_ucred, msghdr);
if (error != 0)
goto done2;
}
@@ -490,7 +490,7 @@ kern_msgctl(td, msqid, cmd, msqbuf)
msqkptr->u.msg_qbytes = 0; /* Mark it as free */
#ifdef MAC
- mac_cleanup_sysv_msgqueue(msqkptr);
+ mac_sysvmsq_cleanup(msqkptr);
#endif
wakeup(msqkptr);
@@ -589,7 +589,7 @@ msgget(td, uap)
goto done2;
}
#ifdef MAC
- error = mac_check_sysv_msqget(cred, msqkptr);
+ error = mac_sysvmsq_check_msqget(cred, msqkptr);
if (error != 0)
goto done2;
#endif
@@ -636,7 +636,7 @@ msgget(td, uap)
msqkptr->u.msg_rtime = 0;
msqkptr->u.msg_ctime = time_second;
#ifdef MAC
- mac_create_sysv_msgqueue(cred, msqkptr);
+ mac_sysvmsq_create(cred, msqkptr);
#endif
} else {
DPRINTF(("didn't find it and wasn't asked to create it\n"));
@@ -705,7 +705,7 @@ kern_msgsnd(td, msqid, msgp, msgsz, msgflg, mtype)
}
#ifdef MAC
- error = mac_check_sysv_msqsnd(td->td_ucred, msqkptr);
+ error = mac_sysvmsq_check_msqsnd(td->td_ucred, msqkptr);
if (error != 0)
goto done2;
#endif
@@ -830,11 +830,11 @@ kern_msgsnd(td, msqid, msgp, msgsz, msgflg, mtype)
msghdr->msg_type = mtype;
#ifdef MAC
/*
- * XXXMAC: Should the mac_check_sysv_msgmsq check follow here
+ * XXXMAC: Should the mac_sysvmsq_check_msgmsq check follow here
* immediately? Or, should it be checked just before the msg is
* enqueued in the msgq (as it is done now)?
*/
- mac_create_sysv_msgmsg(td->td_ucred, msqkptr, msghdr);
+ mac_sysvmsg_create(td->td_ucred, msqkptr, msghdr);
#endif
/*
@@ -928,14 +928,14 @@ kern_msgsnd(td, msqid, msgp, msgsz, msgflg, mtype)
* Note: Since the task/thread allocates the msghdr and usually
* primes it with its own MAC label, for a majority of policies, it
* won't be necessary to check whether the msghdr has access
- * permissions to the msgq. The mac_check_sysv_msqsnd check would
+ * permissions to the msgq. The mac_sysvmsq_check_msqsnd check would
* suffice in that case. However, this hook may be required where
* individual policies derive a non-identical label for the msghdr
* from the current thread label and may want to check the msghdr
* enqueue permissions, along with read/write permissions to the
* msgq.
*/
- error = mac_check_sysv_msgmsq(td->td_ucred, msghdr, msqkptr);
+ error = mac_sysvmsq_check_msgmsq(td->td_ucred, msghdr, msqkptr);
if (error != 0) {
msg_freehdr(msghdr);
wakeup(msqkptr);
@@ -1042,7 +1042,7 @@ kern_msgrcv(td, msqid, msgp, msgsz, msgtyp, msgflg, mtype)
}
#ifdef MAC
- error = mac_check_sysv_msqrcv(td->td_ucred, msqkptr);
+ error = mac_sysvmsq_check_msqrcv(td->td_ucred, msqkptr);
if (error != 0)
goto done2;
#endif
@@ -1061,7 +1061,7 @@ kern_msgrcv(td, msqid, msgp, msgsz, msgtyp, msgflg, mtype)
goto done2;
}
#ifdef MAC
- error = mac_check_sysv_msgrcv(td->td_ucred,
+ error = mac_sysvmsq_check_msgrcv(td->td_ucred,
msghdr);
if (error != 0)
goto done2;
@@ -1106,7 +1106,7 @@ kern_msgrcv(td, msqid, msgp, msgsz, msgtyp, msgflg, mtype)
goto done2;
}
#ifdef MAC
- error = mac_check_sysv_msgrcv(
+ error = mac_sysvmsq_check_msgrcv(
td->td_ucred, msghdr);
if (error != 0)
goto done2;
OpenPOWER on IntegriCloud