changeset 4959:85db430a0119

6560789 BrandZ modules should not use SCCS keywords in user-visible strings 6598081 zonecfg (verify) fails for lx zone using SUNWlx
author edp
date Wed, 29 Aug 2007 10:30:21 -0700
parents 53cc72f735dc
children a4746a82a247
files usr/src/lib/brand/lx/lx_support/lx_support.c usr/src/uts/common/brand/lx/io/lx_audio.c usr/src/uts/common/brand/lx/io/lx_ptm.c usr/src/uts/common/brand/lx/procfs/lx_prvnops.c usr/src/uts/common/brand/sn1/sn1_brand.c usr/src/uts/common/io/zcons.c
diffstat 6 files changed, 34 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/lib/brand/lx/lx_support/lx_support.c	Wed Aug 29 07:20:42 2007 -0700
+++ b/usr/src/lib/brand/lx/lx_support/lx_support.c	Wed Aug 29 10:30:21 2007 -0700
@@ -62,6 +62,7 @@
 
 #define	LXA_AUDIO_DEV		"/dev/brand/lx/audio_devctl"
 #define	INTSTRLEN		32
+#define	KVSTRLEN		10
 
 static char *bname = NULL;
 static char *zonename = NULL;
@@ -190,7 +191,7 @@
 
 	*idev = (char *)malloc(INTSTRLEN);
 	*odev = (char *)malloc(INTSTRLEN);
-	*kvers = (char *)malloc(INTSTRLEN);
+	*kvers = (char *)malloc(KVSTRLEN);
 	if (*idev == NULL || *odev == NULL || *kvers == NULL)
 		lxs_err(gettext("out of memory"));
 
@@ -198,7 +199,7 @@
 	*restart = B_FALSE;
 	bzero(*idev, INTSTRLEN);
 	bzero(*odev, INTSTRLEN);
-	bzero(*kvers, INTSTRLEN);
+	bzero(*kvers, KVSTRLEN);
 	while ((err = zonecfg_getattrent(zdh, &attrtab)) == Z_OK) {
 		if ((strcmp(attrtab.zone_attr_name, "init-restart") == 0) &&
 		    (zonecfg_get_attr_boolean(&attrtab, restart) != Z_OK))
@@ -220,11 +221,16 @@
 			    attrtab.zone_attr_name);
 		if ((strcmp(attrtab.zone_attr_name, "kernel-version") == 0) &&
 		    (zonecfg_get_attr_string(&attrtab, *kvers,
-		    INTSTRLEN) != Z_OK))
+		    KVSTRLEN) != Z_OK))
 			lxs_err(gettext("invalid type for zone attribute: %s"),
 			    attrtab.zone_attr_name);
 	}
 
+	if (strlen(*kvers) == 0) {
+		free(*kvers);
+		*kvers = NULL;
+	}
+
 	/* some kind of error while looking up attributes */
 	if (err != Z_NO_ENTRY)
 		lxs_err(gettext("error accessing zone configuration"));
--- a/usr/src/uts/common/brand/lx/io/lx_audio.c	Wed Aug 29 07:20:42 2007 -0700
+++ b/usr/src/uts/common/brand/lx/io/lx_audio.c	Wed Aug 29 10:30:21 2007 -0700
@@ -19,7 +19,7 @@
  * CDDL HEADER END
  */
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -679,14 +679,14 @@
 		 * fragment we just wrote
 		 */
 		if ((rv = ldi_write(lxa_state->lxas_odev_lh,
-			    &uio, kcred)) != 0) {
+		    &uio, kcred)) != 0) {
 			cmn_err(CE_WARN, "lxa_mmap_thread: "
 			    "ldi_write() failed (%d), "
 			    "resetting audio output", rv);
 			goto lxa_mmap_thread_top;
 		}
 		if ((rv = ldi_write(lxa_state->lxas_odev_lh,
-			    &uio_null, kcred)) != 0) {
+		    &uio_null, kcred)) != 0) {
 			cmn_err(CE_WARN, "lxa_mmap_thread: "
 			    "ldi_write(eof) failed (%d), "
 			    "resetting audio output", rv);
@@ -1226,7 +1226,7 @@
 	 * that handles AUDIO_SETINFO ioctls.
 	 */
 	return (lxa_audio_setinfo(lxa_state, AUDIO_MIXERCTL_SETINFO,
-		(intptr_t)&ai, FKIOCTL));
+	    (intptr_t)&ai, FKIOCTL));
 }
 
 static int
@@ -1236,9 +1236,8 @@
 
 	/* simply return the cached pcm mixer settings */
 	mutex_enter(&lxa_lock);
-	if (ddi_copyout(&lxa_state->lxas_zs->lxa_zs_pcm_levels,
-		(void *)arg,
-		sizeof (lxa_state->lxas_zs->lxa_zs_pcm_levels), mode) != 0) {
+	if (ddi_copyout(&lxa_state->lxas_zs->lxa_zs_pcm_levels, (void *)arg,
+	    sizeof (lxa_state->lxas_zs->lxa_zs_pcm_levels), mode) != 0) {
 		mutex_exit(&lxa_lock);
 		return (EFAULT);
 	}
@@ -1560,7 +1559,7 @@
 
 	/* lookup the zone state structure */
 	if (mod_hash_find(lxa_zstate_hash, (mod_hash_key_t)getzonename(),
-		(mod_hash_val_t *)&lxa_zs) != 0) {
+	    (mod_hash_val_t *)&lxa_zs) != 0) {
 		return (EIO);
 	}
 
@@ -1669,8 +1668,8 @@
 
 	/* get the handle for this device */
 	if (mod_hash_find(lxa_state_hash, (mod_hash_key_t)(uintptr_t)minor,
-	    (mod_hash_val_t *)&lxa_state) != 0) return
-		(EINVAL);
+	    (mod_hash_val_t *)&lxa_state) != 0)
+		return (EINVAL);
 
 	lxa_state_close(lxa_state);
 	return (0);
@@ -1780,7 +1779,7 @@
 			return (lxa_audio_drain(lxa_state));
 		case AUDIO_SETINFO:
 			return (lxa_audio_setinfo(lxa_state,
-				AUDIO_SETINFO, arg, mode));
+			    AUDIO_SETINFO, arg, mode));
 		case AUDIO_GETINFO:
 			return (lxa_audio_getinfo(lxa_state, arg, mode));
 		}
@@ -1791,16 +1790,16 @@
 		switch (cmd) {
 		case LXA_IOC_MIXER_GET_VOL:
 			return (lxa_mixer_get_common(lxa_state,
-				cmd, arg, mode));
+			    cmd, arg, mode));
 		case LXA_IOC_MIXER_SET_VOL:
 			return (lxa_mixer_set_common(lxa_state,
-				cmd, arg, mode));
+			    cmd, arg, mode));
 		case LXA_IOC_MIXER_GET_MIC:
 			return (lxa_mixer_get_common(lxa_state,
-				cmd, arg, mode));
+			    cmd, arg, mode));
 		case LXA_IOC_MIXER_SET_MIC:
 			return (lxa_mixer_set_common(lxa_state,
-				cmd, arg, mode));
+			    cmd, arg, mode));
 		case LXA_IOC_MIXER_GET_PCM:
 			return (lxa_mixer_get_pcm(lxa_state, arg, mode));
 		case LXA_IOC_MIXER_SET_PCM:
@@ -1994,7 +1993,7 @@
  */
 static struct modldrv modldrv = {
 	&mod_driverops,		/* type of module */
-	"linux audio driver 'lx_audio' %I%",
+	"linux audio driver",	/* description of module */
 	&lxa_ops		/* driver ops */
 };
 
--- a/usr/src/uts/common/brand/lx/io/lx_ptm.c	Wed Aug 29 07:20:42 2007 -0700
+++ b/usr/src/uts/common/brand/lx/io/lx_ptm.c	Wed Aug 29 10:30:21 2007 -0700
@@ -1126,9 +1126,9 @@
 };
 
 static struct modldrv modldrv = {
-	&mod_driverops,
-	"Linux master terminal driver 'lx_ptm' %I%",
-	&lx_ptm_ops
+	&mod_driverops,			/* type of module */
+	"Linux master terminal driver",	/* description of module */
+	&lx_ptm_ops			/* driver ops */
 };
 
 static struct modlinkage modlinkage = {
--- a/usr/src/uts/common/brand/lx/procfs/lx_prvnops.c	Wed Aug 29 07:20:42 2007 -0700
+++ b/usr/src/uts/common/brand/lx/procfs/lx_prvnops.c	Wed Aug 29 10:30:21 2007 -0700
@@ -1561,7 +1561,7 @@
 	    __SUNPRO_C & 0xf,
 #endif
 	    LX_UNAME_VERSION,
-	    "00:00:00 %E%");
+	    "00:00:00 00/00/00");
 }
 
 
--- a/usr/src/uts/common/brand/sn1/sn1_brand.c	Wed Aug 29 07:20:42 2007 -0700
+++ b/usr/src/uts/common/brand/sn1/sn1_brand.c	Wed Aug 29 10:30:21 2007 -0700
@@ -121,7 +121,9 @@
 };
 
 static struct modlbrand modlbrand = {
-	&mod_brandops, "Solaris N-1 Brand %I%", &sn1_brand
+	&mod_brandops,		/* type of module */
+	"Solaris N-1 Brand",	/* description of module */
+	&sn1_brand		/* driver ops */
 };
 
 static struct modlinkage modlinkage = {
--- a/usr/src/uts/common/io/zcons.c	Wed Aug 29 07:20:42 2007 -0700
+++ b/usr/src/uts/common/io/zcons.c	Wed Aug 29 10:30:21 2007 -0700
@@ -149,9 +149,9 @@
  */
 
 static struct modldrv modldrv = {
-	&mod_driverops, /* Type of module.  This one is a pseudo driver */
-	"Zone console driver 'zcons' %I%",
-	&zc_ops		/* driver ops */
+	&mod_driverops, 	/* Type of module (this is a pseudo driver) */
+	"Zone console driver",	/* description of module */
+	&zc_ops			/* driver ops */
 };
 
 static struct modlinkage modlinkage = {