PERFORCE change 87155 for review

Robert Watson rwatson at FreeBSD.org
Wed Nov 23 22:38:31 GMT 2005


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

Change 87155 by rwatson at rwatson_zoo on 2005/11/23 22:38:10

	Fix up printfs.
	
	Only printf for device creation of the device is "interesting".

Affected files ...

.. //depot/projects/trustedbsd/mac/sys/security/mac_devfs/mac_devfs.c#3 edit

Differences ...

==== //depot/projects/trustedbsd/mac/sys/security/mac_devfs/mac_devfs.c#3 (text+ko) ====

@@ -66,6 +66,17 @@
 
 #include <sys/mac_policy.h>
 
+static int
+interesting(const char *str1, const char *str2)
+{
+
+	if (str1 == NULL || str2 == NULL)
+		return (0);
+	if (strcmp(str1, str2) == 0)
+		return (0);
+	return (1);
+}
+
 static void
 mac_devfs_associate_vnode_devfs(struct mount *mp, struct label *fslabel,
     struct devfs_dirent *de, struct label *delabel, struct vnode *vp,
@@ -80,8 +91,11 @@
     const char *fullpath)   
 {  
 
+	if (!interesting(dev->si_name, fullpath))
+		return;
+
 	printf("mac_devfs_create_devfs_device(uid %d mp %s cdev %s "
-	    "fullpath %s", cred != NULL ? cred->cr_uid : -1,
+	    "fullpath %s)\n", cred != NULL ? cred->cr_uid : -1,
 	    mp->mnt_stat.f_mntonname, dev->si_name, fullpath);
 }
 
@@ -91,8 +105,8 @@
     const char *fullpath)
 {
 
-	printf("mac_devfs_create_devfs_device(mp %s dirname %s fullpath %s",
-	    mp->mnt_stat.f_mntonname, dirname, fullpath);
+	printf("mac_devfs_create_devfs_directory(mp %s dirname %s "
+	    "fullpath %s)\n", mp->mnt_stat.f_mntonname, dirname, fullpath);
 }
 
 static void
@@ -101,7 +115,7 @@
     struct label *delabel, const char *fullpath)
 {
 
-	printf("mac_devfs_create_devfs_device(uid %d mp %s fullpath %s",
+	printf("mac_devfs_create_devfs_symlink(uid %d mp %s fullpath %s)\n",
 	    cred != NULL ? cred->cr_uid : -1, mp->mnt_stat.f_mntonname,
 	    fullpath);
 }
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