summaryrefslogtreecommitdiffstats
path: root/sys/security/mac_partition
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_partition
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_partition')
-rw-r--r--sys/security/mac_partition/mac_partition.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/security/mac_partition/mac_partition.c b/sys/security/mac_partition/mac_partition.c
index 74df98c..e8ee78a 100644
--- a/sys/security/mac_partition/mac_partition.c
+++ b/sys/security/mac_partition/mac_partition.c
@@ -101,6 +101,13 @@ mac_partition_destroy_label(struct label *label)
SLOT(label) = 0;
}
+static void
+mac_partition_copy_label(struct label *src, struct label *dest)
+{
+
+ SLOT(dest) = SLOT(src);
+}
+
static int
mac_partition_externalize_label(struct label *label, char *element_name,
struct sbuf *sb, int *claimed)
@@ -131,13 +138,6 @@ mac_partition_internalize_label(struct label *label, char *element_name,
}
static void
-mac_partition_create_cred(struct ucred *cred_parent, struct ucred *cred_child)
-{
-
- SLOT(cred_child->cr_label) = SLOT(cred_parent->cr_label);
-}
-
-static void
mac_partition_create_proc0(struct ucred *cred)
{
@@ -271,9 +271,9 @@ static struct mac_policy_ops mac_partition_ops =
.mpo_init = mac_partition_init,
.mpo_init_cred_label = mac_partition_init_label,
.mpo_destroy_cred_label = mac_partition_destroy_label,
+ .mpo_copy_cred_label = mac_partition_copy_label,
.mpo_externalize_cred_label = mac_partition_externalize_label,
.mpo_internalize_cred_label = mac_partition_internalize_label,
- .mpo_create_cred = mac_partition_create_cred,
.mpo_create_proc0 = mac_partition_create_proc0,
.mpo_create_proc1 = mac_partition_create_proc1,
.mpo_relabel_cred = mac_partition_relabel_cred,
OpenPOWER on IntegriCloud