summaryrefslogtreecommitdiffstats
path: root/sys/security/mac_test/mac_test.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2003-12-06 21:48:03 +0000
committerrwatson <rwatson@FreeBSD.org>2003-12-06 21:48:03 +0000
commit08335c63bf85bb1d25ca094ab55a04b390c0acda (patch)
tree80bf1fc6acf72a565465aa4b66b0dba3b2b80af2 /sys/security/mac_test/mac_test.c
parent55ee8acb7fba4f6a262ab48a2a5ed1753cc12dcc (diff)
downloadFreeBSD-src-08335c63bf85bb1d25ca094ab55a04b390c0acda.zip
FreeBSD-src-08335c63bf85bb1d25ca094ab55a04b390c0acda.tar.gz
Rename mac_create_cred() MAC Framework entry point to mac_copy_cred(),
and the mpo_create_cred() MAC policy entry point to mpo_copy_cred_label(). This is more consistent with similar entry points for creation and label copying, as mac_create_cred() was called from crdup() as opposed to during process creation. For a number of policies, this removes the requirement for special handling when copying credential labels, and improves consistency. Approved by: re (scottl) Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
Diffstat (limited to 'sys/security/mac_test/mac_test.c')
-rw-r--r--sys/security/mac_test/mac_test.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/sys/security/mac_test/mac_test.c b/sys/security/mac_test/mac_test.c
index 847c9e9..ef8c5b3 100644
--- a/sys/security/mac_test/mac_test.c
+++ b/sys/security/mac_test/mac_test.c
@@ -591,6 +591,14 @@ mac_test_destroy_vnode_label(struct label *label)
}
static void
+mac_test_copy_cred_label(struct label *src, struct label *dest)
+{
+
+ ASSERT_CRED_LABEL(src);
+ ASSERT_CRED_LABEL(dest);
+}
+
+static void
mac_test_copy_mbuf_label(struct label *src, struct label *dest)
{
@@ -1021,14 +1029,6 @@ mac_test_inpcb_sosetlabel(struct socket *so, struct label *solabel,
* Labeling event operations: processes.
*/
static void
-mac_test_create_cred(struct ucred *cred_parent, struct ucred *cred_child)
-{
-
- ASSERT_CRED_LABEL(cred_parent->cr_label);
- ASSERT_CRED_LABEL(cred_child->cr_label);
-}
-
-static void
mac_test_execve_transition(struct ucred *old, struct ucred *new,
struct vnode *vp, struct label *filelabel,
struct label *interpvnodelabel, struct image_params *imgp,
@@ -1879,6 +1879,7 @@ static struct mac_policy_ops mac_test_ops =
.mpo_destroy_socket_label = mac_test_destroy_socket_label,
.mpo_destroy_socket_peer_label = mac_test_destroy_socket_peer_label,
.mpo_destroy_vnode_label = mac_test_destroy_vnode_label,
+ .mpo_copy_cred_label = mac_test_copy_cred_label,
.mpo_copy_mbuf_label = mac_test_copy_mbuf_label,
.mpo_copy_pipe_label = mac_test_copy_pipe_label,
.mpo_copy_socket_label = mac_test_copy_socket_label,
@@ -1932,7 +1933,6 @@ static struct mac_policy_ops mac_test_ops =
.mpo_relabel_ifnet = mac_test_relabel_ifnet,
.mpo_update_ipq = mac_test_update_ipq,
.mpo_inpcb_sosetlabel = mac_test_inpcb_sosetlabel,
- .mpo_create_cred = mac_test_create_cred,
.mpo_execve_transition = mac_test_execve_transition,
.mpo_execve_will_transition = mac_test_execve_will_transition,
.mpo_create_proc0 = mac_test_create_proc0,
OpenPOWER on IntegriCloud