PERFORCE change 100999 for review
Robert Watson
rwatson at FreeBSD.org
Sat Jul 8 13:23:42 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=100999
Change 100999 by rwatson at rwatson_zoo on 2006/07/08 13:23:30
Rename policy entry points. Remove fs_label.
Affected files ...
.. //depot/projects/trustedbsd/mac2/sys/security/mac_lomac/mac_lomac.c#2 edit
Differences ...
==== //depot/projects/trustedbsd/mac2/sys/security/mac_lomac/mac_lomac.c#2 (text+ko) ====
@@ -1,6 +1,7 @@
/*-
* Copyright (c) 1999-2002 Robert N. M. Watson
* Copyright (c) 2001-2005 Networks Associates Technology, Inc.
+ * Copyright (c) 2006 SPARTA, Inc.
* All rights reserved.
*
* This software was developed by Robert Watson for the TrustedBSD Project.
@@ -10,6 +11,9 @@
* DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the DARPA
* CHATS research program.
*
+ * This software was enhanced by SPARTA ISSO under SPAWAR contract
+ * N66001-04-C-6019 ("SEFOS").
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -604,7 +608,7 @@
* Policy module operations.
*/
static void
-mac_lomac_init(struct mac_policy_conf *conf)
+mac_lomac_policy_init(struct mac_policy_conf *conf)
{
}
@@ -948,15 +952,13 @@
static void
mac_lomac_create_mount(struct ucred *cred, struct mount *mp,
- struct label *mntlabel, struct label *fslabel)
+ struct label *mntlabel)
{
struct mac_lomac *source, *dest;
source = SLOT(cred->cr_label);
dest = SLOT(mntlabel);
mac_lomac_copy_single(source, dest);
- dest = SLOT(fslabel);
- mac_lomac_copy_single(source, dest);
}
static void
@@ -985,7 +987,7 @@
}
static void
-mac_lomac_associate_vnode_devfs(struct mount *mp, struct label *fslabel,
+mac_lomac_associate_vnode_devfs(struct mount *mp, struct label *mntlabel,
struct devfs_dirent *de, struct label *delabel, struct vnode *vp,
struct label *vlabel)
{
@@ -998,13 +1000,13 @@
}
static int
-mac_lomac_associate_vnode_extattr(struct mount *mp, struct label *fslabel,
+mac_lomac_associate_vnode_extattr(struct mount *mp, struct label *mntlabel,
struct vnode *vp, struct label *vlabel)
{
struct mac_lomac temp, *source, *dest;
int buflen, error;
- source = SLOT(fslabel);
+ source = SLOT(mntlabel);
dest = SLOT(vlabel);
buflen = sizeof(temp);
@@ -1013,7 +1015,7 @@
error = vn_extattr_get(vp, IO_NODELOCKED, MAC_LOMAC_EXTATTR_NAMESPACE,
MAC_LOMAC_EXTATTR_NAME, &buflen, (char *)&temp, curthread);
if (error == ENOATTR || error == EOPNOTSUPP) {
- /* Fall back to the fslabel. */
+ /* Fall back to the mntlabel. */
mac_lomac_copy_single(source, dest);
return (0);
} else if (error)
@@ -1046,11 +1048,11 @@
static void
mac_lomac_associate_vnode_singlelabel(struct mount *mp,
- struct label *fslabel, struct vnode *vp, struct label *vlabel)
+ struct label *mntlabel, struct vnode *vp, struct label *vlabel)
{
struct mac_lomac *source, *dest;
- source = SLOT(fslabel);
+ source = SLOT(mntlabel);
dest = SLOT(vlabel);
mac_lomac_copy_single(source, dest);
@@ -1058,7 +1060,7 @@
static int
mac_lomac_create_vnode_extattr(struct ucred *cred, struct mount *mp,
- struct label *fslabel, struct vnode *dvp, struct label *dlabel,
+ struct label *mntlabel, struct vnode *dvp, struct label *dlabel,
struct vnode *vp, struct label *vlabel, struct componentname *cnp)
{
struct mac_lomac *source, *dest, *dir, temp;
@@ -2555,7 +2557,7 @@
static struct mac_policy_ops mac_lomac_ops =
{
- .mpo_init = mac_lomac_init,
+ .mpo_policy_init = mac_lomac_policy_init,
.mpo_init_bpfdesc_label = mac_lomac_init_label,
.mpo_init_cred_label = mac_lomac_init_label,
.mpo_init_devfsdirent_label = mac_lomac_init_label,
@@ -2564,7 +2566,6 @@
.mpo_init_ipq_label = mac_lomac_init_label_waitcheck,
.mpo_init_mbuf_label = mac_lomac_init_label_waitcheck,
.mpo_init_mount_label = mac_lomac_init_label,
- .mpo_init_mount_fs_label = mac_lomac_init_label,
.mpo_init_pipe_label = mac_lomac_init_label,
.mpo_init_proc_label = mac_lomac_init_proc_label,
.mpo_init_socket_label = mac_lomac_init_label_waitcheck,
@@ -2578,7 +2579,6 @@
.mpo_destroy_ipq_label = mac_lomac_destroy_label,
.mpo_destroy_mbuf_label = mac_lomac_destroy_label,
.mpo_destroy_mount_label = mac_lomac_destroy_label,
- .mpo_destroy_mount_fs_label = mac_lomac_destroy_label,
.mpo_destroy_pipe_label = mac_lomac_destroy_label,
.mpo_destroy_proc_label = mac_lomac_destroy_proc_label,
.mpo_destroy_socket_label = mac_lomac_destroy_label,
More information about the trustedbsd-cvs
mailing list