Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Nov 2005 22:38:31 GMT
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 87155 for review
Message-ID:  <200511232238.jANMcV0x098218@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=87155

Change 87155 by rwatson@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);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200511232238.jANMcV0x098218>