diff options
author | Robert Watson <rwatson@FreeBSD.org> | 2003-12-06 21:48:03 +0000 |
---|---|---|
committer | Robert Watson <rwatson@FreeBSD.org> | 2003-12-06 21:48:03 +0000 |
commit | 56d9e932072f81ebaa7bb1bf5995a46813bc91c4 (patch) | |
tree | 80bf1fc6acf72a565465aa4b66b0dba3b2b80af2 /sys/security/mac_partition | |
parent | 302e8edbe896cca55f36187a0a551b1f4a89103b (diff) |
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
Notes
Notes:
svn path=/head/; revision=123173
Diffstat (limited to 'sys/security/mac_partition')
-rw-r--r-- | sys/security/mac_partition/mac_partition.c | 16 |
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 74df98c7c943..e8ee78ac3576 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, |