PERFORCE change 42422 for review

Robert Watson rwatson at FreeBSD.org
Sat Nov 15 03:06:52 GMT 2003


http://perforce.freebsd.org/chv.cgi?CH=42422

Change 42422 by rwatson at rwatson_tislabs on 2003/11/14 19:06:46

	Let mac_prepare_type() initialize the internal database, rather
	than initializing in the older wrapper functions.  Otherwise,
	the database isn't initialized if applications only use
	mac_prepare_type().

Affected files ...

.. //depot/projects/trustedbsd/mac/lib/libc/posix1e/mac.c#12 edit

Differences ...

==== //depot/projects/trustedbsd/mac/lib/libc/posix1e/mac.c#12 (text+ko) ====

@@ -358,9 +358,15 @@
 mac_prepare_type(struct mac **mac, const char *name)
 {
 	struct label_default *ld;
+	int error;
 
+	error = mac_maybe_init_internal();
+	if (error != 0)
+		return (error);
+
 	for (ld = LIST_FIRST(&label_default_head); ld != NULL;
 	    ld = LIST_NEXT(ld, ld_entries)) {
+		printf("%s\n", ld->ld_name);
 		if (strcmp(name, ld->ld_name) == 0)
 			return (mac_prepare(mac, ld->ld_labels));
 	}
@@ -372,23 +378,13 @@
 int
 mac_prepare_ifnet_label(struct mac **mac)
 {
-	int error;
 
-	error = mac_maybe_init_internal();
-	if (error != 0)
-		return (error);
-
 	return (mac_prepare_type(mac, "ifnet"));
 }
 
 int
 mac_prepare_file_label(struct mac **mac)
 {
-	int error;
-
-	error = mac_maybe_init_internal();
-	if (error != 0)
-		return (error);
 
 	return (mac_prepare_type(mac, "file"));
 }
@@ -396,23 +392,13 @@
 int
 mac_prepare_packet_label(struct mac **mac)
 {
-	int error;
 
-	error = mac_maybe_init_internal();
-	if (error != 0)
-		return (error);
-
 	return (mac_prepare_type(mac, "packet"));
 }
 
 int
 mac_prepare_process_label(struct mac **mac)
 {
-	int error;
-
-	error = mac_maybe_init_internal();
-	if (error != 0)
-		return (error);
 
 	return (mac_prepare_type(mac, "process"));
 }
To Unsubscribe: send mail to majordomo at trustedbsd.org
with "unsubscribe trustedbsd-cvs" in the body of the message



More information about the trustedbsd-cvs mailing list