Deleted Added
full compact
mac_partition.c (112717) mac_partition.c (116701)
1/*-
2 * Copyright (c) 1999, 2000, 2001, 2002 Robert N. M. Watson
3 * Copyright (c) 2001, 2002 Networks Associates Technology, Inc.
4 * All rights reserved.
5 *
6 * This software was developed by Robert Watson for the TrustedBSD Project.
7 *
8 * This software was developed for the FreeBSD Project in part by Network

--- 17 unchanged lines hidden (view full) ---

26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 *
1/*-
2 * Copyright (c) 1999, 2000, 2001, 2002 Robert N. M. Watson
3 * Copyright (c) 2001, 2002 Networks Associates Technology, Inc.
4 * All rights reserved.
5 *
6 * This software was developed by Robert Watson for the TrustedBSD Project.
7 *
8 * This software was developed for the FreeBSD Project in part by Network

--- 17 unchanged lines hidden (view full) ---

26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 *
34 * $FreeBSD: head/sys/security/mac_partition/mac_partition.c 112717 2003-03-27 19:26:39Z rwatson $
34 * $FreeBSD: head/sys/security/mac_partition/mac_partition.c 116701 2003-06-23 01:26:34Z rwatson $
35 */
36
37/*
38 * Developed by the TrustedBSD Project.
39 * Experiment with a partition-like model.
40 */
41
42#include <sys/types.h>
43#include <sys/param.h>
44#include <sys/conf.h>
45#include <sys/kernel.h>
46#include <sys/mac.h>
47#include <sys/mount.h>
48#include <sys/proc.h>
35 */
36
37/*
38 * Developed by the TrustedBSD Project.
39 * Experiment with a partition-like model.
40 */
41
42#include <sys/types.h>
43#include <sys/param.h>
44#include <sys/conf.h>
45#include <sys/kernel.h>
46#include <sys/mac.h>
47#include <sys/mount.h>
48#include <sys/proc.h>
49#include <sys/sbuf.h>
49#include <sys/systm.h>
50#include <sys/sysproto.h>
51#include <sys/sysent.h>
52#include <sys/vnode.h>
53#include <sys/file.h>
54#include <sys/socket.h>
55#include <sys/socketvar.h>
56#include <sys/sysctl.h>

--- 40 unchanged lines hidden (view full) ---

97mac_partition_destroy_label(struct label *label)
98{
99
100 SLOT(label) = 0;
101}
102
103static int
104mac_partition_externalize_label(struct label *label, char *element_name,
50#include <sys/systm.h>
51#include <sys/sysproto.h>
52#include <sys/sysent.h>
53#include <sys/vnode.h>
54#include <sys/file.h>
55#include <sys/socket.h>
56#include <sys/socketvar.h>
57#include <sys/sysctl.h>

--- 40 unchanged lines hidden (view full) ---

98mac_partition_destroy_label(struct label *label)
99{
100
101 SLOT(label) = 0;
102}
103
104static int
105mac_partition_externalize_label(struct label *label, char *element_name,
105 char *element_data, size_t size, size_t *len, int *claimed)
106 struct sbuf *sb, int *claimed)
106{
107
108 if (strcmp(MAC_PARTITION_LABEL_NAME, element_name) != 0)
109 return (0);
110
111 (*claimed)++;
107{
108
109 if (strcmp(MAC_PARTITION_LABEL_NAME, element_name) != 0)
110 return (0);
111
112 (*claimed)++;
112 *len = snprintf(element_data, size, "%ld", SLOT(label));
113 return (0);
113
114 if (sbuf_printf(sb, "%ld", SLOT(label)) == -1)
115 return (EINVAL);
116 else
117 return (0);
114}
115
116static int
117mac_partition_internalize_label(struct label *label, char *element_name,
118 char *element_data, int *claimed)
119{
120
121 if (strcmp(MAC_PARTITION_LABEL_NAME, element_name) != 0)

--- 165 unchanged lines hidden ---
118}
119
120static int
121mac_partition_internalize_label(struct label *label, char *element_name,
122 char *element_data, int *claimed)
123{
124
125 if (strcmp(MAC_PARTITION_LABEL_NAME, element_name) != 0)

--- 165 unchanged lines hidden ---