--- old/usr/src/cmd/init/init.c	Sat Jun  1 10:02:47 2013
+++ new/usr/src/cmd/init/init.c	Sat Jun  1 10:02:47 2013
@@ -20,6 +20,8 @@
  */
 
 /*
+ * Copyright (c) 2013 Gary Mills
+ *
  * Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved.
  */
 
@@ -139,6 +141,7 @@
 #define	FALSE	0
 #define	FAILURE	-1
 
+#define	UT_USER_SZ	32	/* Size of a utmpx ut_user field */
 #define	UT_LINE_SZ	32	/* Size of a utmpx ut_line field */
 
 /*
@@ -1603,11 +1606,11 @@
 		for (proceed = TRUE, ptr = shcmd, state = ID, lastc = '\0';
 		    proceed && c != EOF;
 		    lastc = c, c = fgetc(fp_inittab)) {
-		    /* If we're not in the FAILURE state and haven't	*/
-		    /* yet reached the shell command field, process	*/
-		    /* the line, otherwise just look for a real end	*/
-		    /* of line.						*/
-		    if (state != FAILURE && state != COMMAND) {
+			/* If we're not in the FAILURE state and haven't */
+			/* yet reached the shell command field, process	 */
+			/* the line, otherwise just look for a real end	 */
+			/* of line.					 */
+			if (state != FAILURE && state != COMMAND) {
 			/*
 			 * Squeeze out spaces and tabs.
 			 */
@@ -1643,9 +1646,9 @@
 			 * to the next field.
 			 */
 			if (c == ':') {
-			    switch (state) {
+				switch (state) {
 
-			    case ID :
+				case ID :
 				/*
 				 * Check to see that there are only
 				 * 1 to 4 characters for the id.
@@ -1659,7 +1662,7 @@
 				}
 				break;
 
-			    case LEVELS :
+				case LEVELS :
 				/*
 				 * Build a mask for all the levels for
 				 * which this command will be legal.
@@ -1680,7 +1683,7 @@
 				}
 				break;
 
-			    case ACTION :
+				case ACTION :
 				/*
 				 * Null terminate the string in shcmd buffer and
 				 * then try to match against legal actions.  If
@@ -1691,27 +1694,30 @@
 				if (ptr == shcmd) {
 					if (isdigit(cmd->c_id[0]) &&
 					    (cmd->c_id[1] == '\0' ||
-						isdigit(cmd->c_id[1])) &&
+					    isdigit(cmd->c_id[1])) &&
 					    (cmd->c_id[2] == '\0' ||
-						isdigit(cmd->c_id[2])) &&
+					    isdigit(cmd->c_id[2])) &&
 					    (cmd->c_id[3] == '\0' ||
-						isdigit(cmd->c_id[3])))
-						    cmd->c_action = M_RESPAWN;
+					    isdigit(cmd->c_id[3])))
+						cmd->c_action = M_RESPAWN;
 					else
-						    cmd->c_action = M_OFF;
+						cmd->c_action = M_OFF;
 				} else {
-				    for (cmd->c_action = 0, i = 0, *ptr = '\0';
-				    i < sizeof (actions)/sizeof (char *);
-				    i++) {
+					for (cmd->c_action = 0, i = 0,
+					    *ptr = '\0';
+					    i <
+					    sizeof (actions)/sizeof (char *);
+					    i++) {
 					if (strcmp(shcmd, actions[i]) == 0) {
-					    if ((cmd->c_levels & MASKSU) &&
-						!(act_masks[i] & su_acts))
-						    cmd->c_action = 0;
-					    else
-						cmd->c_action = act_masks[i];
-					    break;
+						if ((cmd->c_levels & MASKSU) &&
+						    !(act_masks[i] & su_acts))
+							cmd->c_action = 0;
+						else
+							cmd->c_action =
+							    act_masks[i];
+						break;
 					}
-				    }
+					}
 				}
 
 				/*
@@ -1726,38 +1732,38 @@
 				}
 				ptr = shcmd + EXEC;
 				break;
-			    }
-			    continue;
+				}
+				continue;
 			}
-		    }
+		}
 
-		    /* If the character is a '\n', then this is the end of a */
-		    /* line.  If the '\n' wasn't preceded by a backslash, */
-		    /* it is also the end of an inittab command.  If it was */
-		    /* preceded by a backslash then the next line is a */
-		    /* continuation.  Note that the continuation '\n' falls */
-		    /* through and is treated like other characters and is */
-		    /* stored in the shell command line. */
-		    if (c == '\n' && lastc != '\\') {
-				proceed = FALSE;
-				*ptr = '\0';
-				break;
-		    }
+		/* If the character is a '\n', then this is the end of a */
+		/* line.  If the '\n' wasn't preceded by a backslash, */
+		/* it is also the end of an inittab command.  If it was */
+		/* preceded by a backslash then the next line is a */
+		/* continuation.  Note that the continuation '\n' falls */
+		/* through and is treated like other characters and is */
+		/* stored in the shell command line. */
+		if (c == '\n' && lastc != '\\') {
+			proceed = FALSE;
+			*ptr = '\0';
+			break;
+		}
 
-		    /* For all other characters just stuff them into the */
-		    /* command as long as there aren't too many of them. */
-		    /* Make sure there is room for a terminating '\0' also. */
-		    if (ptr >= shcmd + MAXCMDL - 1)
+		/* For all other characters just stuff them into the */
+		/* command as long as there aren't too many of them. */
+		/* Make sure there is room for a terminating '\0' also. */
+		if (ptr >= shcmd + MAXCMDL - 1)
 			state = FAILURE;
-		    else
+		else
 			*ptr++ = (char)c;
 
-		    /* If the character we just stored was a quoted	*/
-		    /* backslash, then change "c" to '\0', so that this	*/
-		    /* backslash will not cause a subsequent '\n' to appear */
-		    /* quoted.  In otherwords '\' '\' '\n' is the real end */
-		    /* of a command, while '\' '\n' is a continuation. */
-		    if (c == '\\' && lastc == '\\')
+		/* If the character we just stored was a quoted	*/
+		/* backslash, then change "c" to '\0', so that this	*/
+		/* backslash will not cause a subsequent '\n' to appear */
+		/* quoted.  In otherwords '\' '\' '\n' is the real end */
+		/* of a command, while '\' '\n' is a continuation. */
+		if (c == '\\' && lastc == '\\')
 			c = '\0';
 		}
 
@@ -2110,7 +2116,9 @@
 "Command\n\"%s\"\n failed to execute.  errno = %d (exec of shell failed)\n",
 					    cmd.c_command, errno);
 					exit(1);
-				} else while (waitproc(process) == FAILURE);
+				} else
+					while (waitproc(process) == FAILURE)
+						;
 				process->p_flags = 0;
 				st_write();
 			}
@@ -2808,8 +2816,7 @@
 prog_name(char *string)
 {
 	char	*ptr, *ptr2;
-	/* XXX - utmp - fix name length */
-	static char word[_POSIX_LOGIN_NAME_MAX];
+	static char word[UT_USER_SZ + 1];
 
 	/*
 	 * Search for the first word skipping leading spaces and tabs.
@@ -2844,8 +2851,7 @@
 	 * Copy out up to the size of the "ut_user" array into "word",
 	 * null terminate it and return a pointer to it.
 	 */
-	/* XXX - utmp - fix name length */
-	for (ptr2 = &word[0]; ptr2 < &word[_POSIX_LOGIN_NAME_MAX - 1] &&
+	for (ptr2 = &word[0]; ptr2 < &word[UT_USER_SZ] &&
 	    ptr < string; /* CSTYLED */)
 		*ptr2++ = *ptr++;
 
@@ -2897,22 +2903,22 @@
 		    IOCTLSYSCON);
 	} else {
 
-	    i = fscanf(fp,
+		i = fscanf(fp,
 	    "%x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x",
-		&iflags, &oflags, &cflags, &lflags,
-		&cc[0], &cc[1], &cc[2], &cc[3], &cc[4], &cc[5], &cc[6],
-		&cc[7], &cc[8], &cc[9], &cc[10], &cc[11], &cc[12], &cc[13],
-		&cc[14], &cc[15], &cc[16], &cc[17]);
+		    &iflags, &oflags, &cflags, &lflags,
+		    &cc[0], &cc[1], &cc[2], &cc[3], &cc[4], &cc[5], &cc[6],
+		    &cc[7], &cc[8], &cc[9], &cc[10], &cc[11], &cc[12], &cc[13],
+		    &cc[14], &cc[15], &cc[16], &cc[17]);
 
-	    if (i == 22) {
-		stored_syscon_termios.c_iflag = iflags;
-		stored_syscon_termios.c_oflag = oflags;
-		stored_syscon_termios.c_cflag = cflags;
-		stored_syscon_termios.c_lflag = lflags;
-		for (i = 0; i < 18; i++)
-			stored_syscon_termios.c_cc[i] = (char)cc[i];
-		valid_format = 1;
-	    } else if (i == 13) {
+		if (i == 22) {
+			stored_syscon_termios.c_iflag = iflags;
+			stored_syscon_termios.c_oflag = oflags;
+			stored_syscon_termios.c_cflag = cflags;
+			stored_syscon_termios.c_lflag = lflags;
+			for (i = 0; i < 18; i++)
+				stored_syscon_termios.c_cc[i] = (char)cc[i];
+			valid_format = 1;
+		} else if (i == 13) {
 		rewind(fp);
 		i = fscanf(fp, "%x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x",
 		    &iflags, &oflags, &cflags, &lflags, &ldisc, &cc[0], &cc[1],
@@ -2929,12 +2935,12 @@
 		for (i = 0; i < 8; i++)
 			stored_syscon_termios.c_cc[i] = (char)cc[i];
 		valid_format = 1;
-	    }
-	    (void) fclose(fp);
+		}
+		(void) fclose(fp);
 
-	    /* If the file is badly formatted, use the default settings. */
-	    if (!valid_format)
-		stored_syscon_termios = dflt_termios;
+		/* If the file is badly formatted, use the default settings. */
+		if (!valid_format)
+			stored_syscon_termios = dflt_termios;
 	}
 
 	/* If the file had a bad format, rewrite it later. */
@@ -3807,7 +3813,8 @@
 	 */
 	do
 		ptr = realloc(g_state, g_state_sz + delta);
-	while (ptr == NULL && errno == EAGAIN);
+	while (ptr == NULL && errno == EAGAIN)
+		;
 
 	if (ptr != NULL) {
 		/* ensure that the new part is initialized to zero */
@@ -3914,13 +3921,15 @@
 	/* Get the size of the file. */
 	do
 		ret = fstat(st_fd, &stb);
-	while (ret == -1 && errno == EINTR);
+	while (ret == -1 && errno == EINTR)
+		;
 	if (ret == -1)
 		goto new_state;
 
 	do
 		g_state = malloc(stb.st_size);
-	while (g_state == NULL && errno == EAGAIN);
+	while (g_state == NULL && errno == EAGAIN)
+		;
 	if (g_state == NULL)
 		goto new_state;
 
@@ -3966,7 +3975,8 @@
 	    ((init_num_proc - 1) * sizeof (struct PROC_TABLE));
 	do
 		g_state = calloc(1, g_state_sz);
-	while (g_state == NULL && errno == EAGAIN);
+	while (g_state == NULL && errno == EAGAIN)
+		;
 	if (g_state == NULL) {
 		/* Fatal error! */
 		exit(errno);
@@ -4074,7 +4084,8 @@
 
 	do
 		fd = open64(CTFS_ROOT "/process/template", O_RDWR);
-	while (fd < 0 && errno == EINTR);
+	while (fd < 0 && errno == EINTR)
+		;
 	if (fd < 0) {
 		console(B_TRUE, "Couldn't create process template: %s.\n",
 		    strerror(errno));
@@ -4171,7 +4182,8 @@
 	 */
 	do
 		fd = open64(CTFS_ROOT "/process/pbundle", O_RDONLY);
-	while (fd < 0 && errno == EINTR);
+	while (fd < 0 && errno == EINTR)
+		;
 	if (fd < 0) {
 		console(B_TRUE,
 		    "Couldn't open process pbundle: %s.  Core smf(5) services "
@@ -4204,7 +4216,8 @@
 
 	do
 		fd = contract_open(id, "process", name, oflag);
-	while (fd < 0 && errno == EINTR);
+	while (fd < 0 && errno == EINTR)
+		;
 
 	if (fd < 0)
 		console(B_TRUE, "Couldn't open %s for contract %ld: %s.\n",
--- old/usr/src/cmd/last/last.c	Sat Jun  1 10:02:48 2013
+++ new/usr/src/cmd/last/last.c	Sat Jun  1 10:02:48 2013
@@ -20,6 +20,8 @@
  * CDDL HEADER END
  */
 /*
+ * Copyright (c) 2013 Gary Mills
+ *
  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
@@ -39,8 +41,6 @@
  * contributors.
  */
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 /*
  * last
  */
@@ -58,13 +58,16 @@
 #include <ctype.h>
 
 /*
- * NMAX, LMAX and HMAX are set to these values for now. They
- * should be much higher because of the max allowed limit in
- * utmpx.h
+ * Use the full lengths from utmpx for NMAX, LMAX and HMAX .
  */
-#define	NMAX	8
-#define	LMAX	12
+#define	NMAX	(sizeof (((struct utmpx *)0)->ut_user))
+#define	LMAX	(sizeof (((struct utmpx *)0)->ut_line))
 #define	HMAX	(sizeof (((struct utmpx *)0)->ut_host))
+
+/* Print minimum field widths. */
+#define	LOGIN_WIDTH	8
+#define	LINE_WIDTH	12
+
 #define	SECDAY	(24*60*60)
 #define	CHUNK_SIZE 256
 
@@ -254,9 +257,9 @@
 			if (want(bp, &ut_host, &ut_user)) {
 				for (i = 0; i <= lines; i++) {
 				if (i == lines)
-				    reallocate_buffer();
+					reallocate_buffer();
 				if (ttnames[i] == NULL) {
-				    memory_alloc(i);
+					memory_alloc(i);
 					/*
 					 * LMAX+HMAX+NMAX+3 bytes have been
 					 * allocated for ttnames[i].
@@ -266,13 +269,13 @@
 					 * truncate it to fit ttnames[i].
 					 */
 					(void) strlcpy(ttnames[i], bp->ut_line,
-						LMAX+1);
+					    LMAX+1);
 					(void) strlcpy(ttnames[i]+LMAX+1,
-						ut_host, HMAX+1);
+					    ut_host, HMAX+1);
 					(void) strlcpy(ttnames[i]+LMAX+HMAX+2,
-						ut_user, NMAX+1);
+					    ut_user, NMAX+1);
 						record_time(&otime, &print,
-							i, bp);
+						    i, bp);
 						break;
 					} else if (linehostnameq(ttnames[i],
 					    bp->ut_line, ut_host, ut_user)) {
@@ -290,14 +293,14 @@
 
 				ct = ctime(&bp->ut_xtime);
 				(void) printf(gettext("%-*.*s  %-*.*s "),
-				    NMAX, NMAX, bp->ut_name,
-				    LMAX, LMAX, bp->ut_line);
+				    LOGIN_WIDTH, NMAX, bp->ut_name,
+				    LINE_WIDTH, LMAX, bp->ut_line);
 				hostf_len = strlen(bp->ut_host);
 				(void) snprintf(hostf, sizeof (hostf),
 				    "%-*.*s", hostf_len, hostf_len,
 				    bp->ut_host);
 				fpos = snprintf(timef, sizeof (timef),
-					"%10.10s %5.5s ",
+				    "%10.10s %5.5s ",
 				    ct, 11 + ct);
 				if (!lineq(bp->ut_line, "system boot") &&
 				    !lineq(bp->ut_line, "system down")) {
@@ -307,7 +310,7 @@
 	if (fpos < sizeof (timef)) {
 		/* timef still has room */
 		(void) snprintf(timef + fpos, sizeof (timef) - fpos,
-			gettext("  still logged in"));
+		    gettext("  still logged in"));
 	}
 
 					} else {
@@ -331,7 +334,7 @@
 	if (fpos < sizeof (timef)) {
 		/* timef still has room */
 		chrcnt = snprintf(timef + fpos, sizeof (timef) - fpos,
-			gettext("- %s"), crmsg);
+		    gettext("- %s"), crmsg);
 		fpos += chrcnt;
 	}
 
@@ -340,7 +343,7 @@
 	if (fpos < sizeof (timef)) {
 		/* timef still has room */
 		chrcnt = snprintf(timef + fpos, sizeof (timef) - fpos,
-			gettext("- %5.5s"), ctime(&otime) + 11);
+		    gettext("- %5.5s"), ctime(&otime) + 11);
 		fpos += chrcnt;
 	}
 
@@ -351,7 +354,7 @@
 	if (fpos < sizeof (timef)) {
 		/* timef still has room */
 		(void) snprintf(timef + fpos, sizeof (timef) - fpos,
-			gettext("  (%5.5s)"), asctime(gmtime(&delta)) + 11);
+		    gettext("  (%5.5s)"), asctime(gmtime(&delta)) + 11);
 	}
 
 					} else {
@@ -359,7 +362,7 @@
 	if (fpos < sizeof (timef)) {
 		/* timef still has room */
 		(void) snprintf(timef + fpos, sizeof (timef) - fpos,
-			gettext(" (%ld+%5.5s)"), delta / SECDAY,
+		    gettext(" (%ld+%5.5s)"), delta / SECDAY,
 		    asctime(gmtime(&delta)) + 11);
 	}
 
@@ -418,8 +421,8 @@
 		(void) fprintf(stderr, gettext("Out of memory \n"));
 		exit(2);
 	} else {
-	    ttnames = tmpttnames;
-	    logouts = tmplogouts;
+		ttnames = tmpttnames;
+		logouts = tmplogouts;
 	}
 	for (j = lines-CHUNK_SIZE; j < lines; j++) {
 		ttnames[j] = NULL;
--- old/usr/src/cmd/newtask/newtask.c	Sat Jun  1 10:02:48 2013
+++ new/usr/src/cmd/newtask/newtask.c	Sat Jun  1 10:02:48 2013
@@ -20,12 +20,12 @@
  * CDDL HEADER END
  */
 /*
+ * Copyright (c) 2013 Gary Mills
+ *
  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 #include <sys/types.h>
 #include <sys/task.h>
 
@@ -696,7 +696,7 @@
 	if (projname == NULL || getuid() == (uid_t)0)
 		return (pw);
 
-	(void) strcpy(username, pw->pw_name);
+	(void) strlcpy(username, pw->pw_name, sizeof (username));
 
 	if (inproj(username, projname, prbuf, PROJECT_BUFSZ) == 0) {
 		char **u;
--- old/usr/src/cmd/oamuser/inc/users.h	Sat Jun  1 10:02:48 2013
+++ new/usr/src/cmd/oamuser/inc/users.h	Sat Jun  1 10:02:48 2013
@@ -19,6 +19,8 @@
  * CDDL HEADER END
  */
 /*
+ * Copyright (c) 2013 Gary Mills
+ *
  * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
  */
 
@@ -45,6 +47,7 @@
 #define	UNIQUE		2	/* is unique */
 #define	TOOBIG		3	/* number too big */
 #define	INVALID		4
+#define	LONGNAME	5	/* string too long */
 
 /*
  * Note: constraints checking for warning (release 2.6),
--- old/usr/src/cmd/oamuser/lib/vlogin.c	Sat Jun  1 10:02:48 2013
+++ new/usr/src/cmd/oamuser/lib/vlogin.c	Sat Jun  1 10:02:48 2013
@@ -20,6 +20,8 @@
  * CDDL HEADER END
  */
 /*
+ * Copyright (c) 2013 Gary Mills
+ *
  * Copyright (c) 1997, by Sun Microsystems, Inc.
  * All rights reserved.
  */
@@ -27,9 +29,6 @@
 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
 /*	  All Rights Reserved  	*/
 
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"	/* SVr4.0 1.3 */
-
 /*LINTLIBRARY*/
 
 #include	<sys/types.h>
@@ -37,8 +36,12 @@
 #include	<ctype.h>
 #include	<userdefs.h>
 #include	<users.h>
+#include	<deflt.h>
 #include	<limits.h>
 
+/* Defaults file */
+#define	DEFAULT_USERADD "/etc/default/useradd"
+
 /*
  * validate string given as login name.
  */
@@ -49,6 +52,7 @@
 	char *ptr = login;
 	int bad1char, badc, clower, len;
 	char c;
+	char action;
 
 	len = 0; clower = 0; badc = 0; bad1char = 0;
 	*warning = 0;
@@ -68,12 +72,34 @@
 			clower++;
 	}
 
-	/*
-	 * XXX length checking causes some operational/compatibility problem.
-	 * This has to be revisited in the future as ARC/standards issue.
-	 */
+	action = 'w';
+	if (defopen(DEFAULT_USERADD) == 0) {
+		char *defptr;
+
+		if ((defptr = defread("EXCEED_TRAD=")) != NULL) {
+			char let = tolower(*defptr);
+
+			switch (let) {
+			case 'w':	/* warning */
+			case 'e':	/* error */
+			case 's':	/* silent */
+				action = let;
+				break;
+			}
+		}
+		(void) defopen((char *)NULL);
+	}
+
 	if (len > LOGNAME_MAX)
-		*warning = *warning | WARN_NAME_TOO_LONG;
+		return (LONGNAME);
+
+	if (len > LOGNAME_MAX_TRAD) {
+		if (action == 'w')
+			*warning = *warning | WARN_NAME_TOO_LONG;
+		else if (action == 'e')
+			return (LONGNAME);
+	}
+
 	if (clower == 0)
 		*warning = *warning | WARN_NO_LOWERCHAR;
 	if (badc != 0)
--- old/usr/src/cmd/oamuser/user/Makefile	Sat Jun  1 10:02:48 2013
+++ new/usr/src/cmd/oamuser/user/Makefile	Sat Jun  1 10:02:48 2013
@@ -18,6 +18,7 @@
 #
 # CDDL HEADER END
 #
+# Copyright (c) 2013 Gary Mills
 #
 # Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
 #
@@ -24,6 +25,8 @@
 # cmd/oamuser/user/Makefile
 #
 
+DEFAULTFILES= useradd.dfl
+
 include ../../Makefile.cmd
 
 GREP=		grep
@@ -102,7 +105,8 @@
 $(USERMOD):	$(MOD_OBJ)
 $(USERDEL):	$(DEL_OBJ)
 
-install:	all .WAIT $(ROOTSKEL) $(INSSBINPROG) $(INSSKELFILE)
+install:	all $(ROOTETCDEFAULTFILES) .WAIT \
+			$(ROOTSKEL) $(INSSBINPROG) $(INSSKELFILE)
 		$(RM) $(ROOTUSRSBIN)/$(ROLEADD)
 		$(LN) $(ROOTUSRSBIN)/$(USERADD) $(ROOTUSRSBIN)/$(ROLEADD)
 		$(RM) $(ROOTUSRSBIN)/$(ROLEDEL)
--- old/usr/src/cmd/oamuser/user/messages.c	Sat Jun  1 10:02:48 2013
+++ new/usr/src/cmd/oamuser/user/messages.c	Sat Jun  1 10:02:48 2013
@@ -23,12 +23,12 @@
 
 
 /*
+ * Copyright (c) 2013 Gary Mills
+ *
  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"	/* SVr4.0 1.6 */
-
 char *errmsgs[] = {
 	"WARNING: uid %ld is reserved.\n",
 	"WARNING: more than NGROUPS_MAX(%d) groups specified.\n",
@@ -99,6 +99,7 @@
 	"WARNING: gid %ld is reserved.\n",
 	"ERROR: Failed to read /etc/group file due to invalid entry or"
 	    " read error.\n",
+	"ERROR: %s is too long.  Choose another.\n",
 };
 
 int lasterrmsg = sizeof (errmsgs) / sizeof (char *);
--- old/usr/src/cmd/oamuser/user/messages.h	Sat Jun  1 10:02:48 2013
+++ new/usr/src/cmd/oamuser/user/messages.h	Sat Jun  1 10:02:48 2013
@@ -23,6 +23,8 @@
 
 
 /*
+ * Copyright (c) 2013 Gary Mills
+ *
  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
@@ -30,8 +32,6 @@
 #ifndef	_MESSAGES_H
 #define	_MESSAGES_H
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 extern void errmsg(int, ...);
 
 /* WARNING: uid %d is reserved. */
@@ -149,4 +149,7 @@
 /* ERROR: Failed to read /etc/group file due to invalid entry or read error. */
 #define	M_READ_ERROR	37
 
+/* ERROR: %s is too long.  Choose another. */
+#define	M_TOO_LONG	38
+
 #endif /* _MESSAGES_H */
--- old/usr/src/cmd/oamuser/user/useradd.c	Sat Jun  1 10:02:48 2013
+++ new/usr/src/cmd/oamuser/user/useradd.c	Sat Jun  1 10:02:48 2013
@@ -19,6 +19,8 @@
  * CDDL HEADER END
  */
 /*
+ * Copyright (c) 2013 Gary Mills
+ *
  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
@@ -393,6 +395,11 @@
 		errmsg(M_USED, logname);
 		exit(EX_NAME_EXISTS);
 		/*NOTREACHED*/
+
+	case LONGNAME:
+		errmsg(M_TOO_LONG, logname);
+		exit(EX_BADARG);
+		/*NOTREACHED*/
 	}
 
 	if (warning)
--- /dev/null	Sat Jun  1 10:02:48 2013
+++ new/usr/src/cmd/oamuser/user/useradd.dfl	Sat Jun  1 10:02:48 2013
@@ -0,0 +1,33 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright (c) 2013 Gary Mills
+
+# The EXCEED_TRAD indicates the action when the traditional login name
+# length limit of eight characters is exceeded.  The value "warning"
+# means to issue a warning message and continue.  This is the default.
+# The value "error" means to issue an error message and terminate.
+# The value "silent" means to continue without issuing any message.
+#
+EXCEED_TRAD=warning
+#EXCEED_TRAD=error
+#EXCEED_TRAD=silent
+
--- old/usr/src/cmd/oamuser/user/usermod.c	Sat Jun  1 10:02:48 2013
+++ new/usr/src/cmd/oamuser/user/usermod.c	Sat Jun  1 10:02:48 2013
@@ -19,6 +19,8 @@
  * CDDL HEADER END
  */
 /*
+ * Copyright (c) 2013 Gary Mills
+ *
  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
@@ -368,6 +370,12 @@
 			errmsg(M_USED, new_logname);
 			exit(EX_NAME_EXISTS);
 			/*NOTREACHED*/
+
+		case LONGNAME:
+			errmsg(M_TOO_LONG, new_logname);
+			exit(EX_BADARG);
+			/*NOTREACHED*/
+
 		default:
 			call_pass = 1;
 			break;
--- old/usr/src/cmd/prstat/prstat.c	Sat Jun  1 10:02:49 2013
+++ new/usr/src/cmd/prstat/prstat.c	Sat Jun  1 10:02:49 2013
@@ -20,6 +20,8 @@
  */
 
 /*
+ * Copyright (c) 2013 Gary Mills
+ *
  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  *
@@ -75,6 +77,10 @@
 #include <curses.h>
 #include <term.h>
 
+#define	LOGIN_WIDTH	8
+#define	ZONE_WIDTH	28
+#define	PROJECT_WIDTH	28
+
 #define	PSINFO_HEADER_PROC \
 "   PID USERNAME  SIZE   RSS STATE  PRI NICE      TIME  CPU PROCESS/NLWP       "
 #define	PSINFO_HEADER_PROC_LGRP \
@@ -108,8 +114,8 @@
 #define	PSINFO_LINE_LGRP \
 "%6d %-8s %5s %5s %-6s %3s  %3s %9s %3.3s%% %4d %-.16s/%d"
 #define	USAGE_LINE \
-"%6d %-8s %3.3s %3.3s %3.3s %3.3s %3.3s %3.3s %3.3s %3.3s %3.3s %3.3s %3.3s "\
-"%3.3s %-.12s/%d"
+"%6d %-8s %3.3s %3.3s %3.3s %3.3s %3.3s %3.3s %3.3s %3.3s %3.3s %3.3s "\
+"%3.3s %3.3s %-.12s/%d"
 #define	USER_LINE \
 "%6d %-8s %5.5s %5.5s   %3.3s%% %9s %3.3s%%"
 #define	TASK_LINE \
@@ -446,16 +452,23 @@
 				mem = (100 * id->id_pctmem) / total_mem;
 			else
 				mem = id->id_pctmem;
-			if (list->l_type == LT_USERS)
-				pwd_getname(id->id_uid, pname, LOGNAME_MAX + 1,
-				    opts.o_outpmode & OPT_NORESOLVE);
-			else if (list->l_type == LT_ZONES)
+			if (list->l_type == LT_USERS) {
+				pwd_getname(id->id_uid, pname, sizeof (pname),
+				    opts.o_outpmode & OPT_NORESOLVE,
+				    opts.o_outpmode & (OPT_TERMCAP|OPT_TRUNC),
+				    LOGIN_WIDTH);
+			} else if (list->l_type == LT_ZONES) {
 				getzonename(id->id_zoneid, zonename,
-				    ZONENAME_MAX);
-			else
+				    sizeof (zonename),
+				    opts.o_outpmode & (OPT_TERMCAP|OPT_TRUNC),
+				    ZONE_WIDTH);
+			} else {
 				getprojname(id->id_projid, projname,
-				    PROJNAME_MAX,
-				    opts.o_outpmode & OPT_NORESOLVE);
+				    sizeof (projname),
+				    opts.o_outpmode & OPT_NORESOLVE,
+				    opts.o_outpmode & (OPT_TERMCAP|OPT_TRUNC),
+				    PROJECT_WIDTH);
+			}
 			Format_size(psize, id->id_size, 6);
 			Format_size(prssize, id->id_rssize, 6);
 			Format_pct(pmem, mem, 4);
@@ -488,8 +501,10 @@
 			else
 				lwpid = lwp->li_info.pr_nlwp +
 				    lwp->li_info.pr_nzomb;
-			pwd_getname(lwp->li_info.pr_uid, pname, LOGNAME_MAX + 1,
-			    opts.o_outpmode & OPT_NORESOLVE);
+			pwd_getname(lwp->li_info.pr_uid, pname, sizeof (pname),
+			    opts.o_outpmode & OPT_NORESOLVE,
+			    opts.o_outpmode & (OPT_TERMCAP|OPT_TRUNC),
+			    LOGIN_WIDTH);
 			if (opts.o_outpmode & OPT_PSINFO) {
 				Format_size(psize, lwp->li_info.pr_size, 6);
 				Format_size(prssize, lwp->li_info.pr_rssize, 6);
@@ -522,14 +537,15 @@
 				if (opts.o_outpmode & OPT_LGRP) {
 					(void) printf(PSINFO_LINE_LGRP,
 					    (int)lwp->li_info.pr_pid, pname,
-					    psize, prssize, pstate, ppri, pnice,
-					    ptime, pcpu,
+					    psize, prssize, pstate,
+					    ppri, pnice, ptime, pcpu,
 					    (int)lwp->li_info.pr_lwp.pr_lgrp,
 					    lwp->li_info.pr_fname, lwpid);
 				} else {
 					(void) printf(PSINFO_LINE,
 					    (int)lwp->li_info.pr_pid, pname,
-					    psize, prssize, pstate, ppri, pnice,
+					    psize, prssize,
+					    pstate, ppri, pnice,
 					    ptime, pcpu,
 					    lwp->li_info.pr_fname, lwpid);
 				}
@@ -1364,7 +1380,7 @@
 	pagesize = sysconf(_SC_PAGESIZE);
 
 	while ((opt = getopt(argc, argv,
-	    "vcd:HmarRLtu:U:n:p:C:P:h:s:S:j:k:TJz:Z")) != (int)EOF) {
+	    "vcd:HmarRLtu:U:n:p:C:P:h:s:S:j:k:TJWz:Z")) != (int)EOF) {
 		switch (opt) {
 		case 'r':
 			opts.o_outpmode |= OPT_NORESOLVE;
@@ -1461,6 +1477,9 @@
 		case 'L':
 			opts.o_outpmode |= OPT_LWPS;
 			break;
+		case 'W':
+			opts.o_outpmode |= OPT_TRUNC;
+			break;
 		case 'z':
 			if ((p = strtok(optarg, ", ")) == NULL)
 				Die(gettext("invalid argument for -z\n"));
--- old/usr/src/cmd/prstat/prstat.h	Sat Jun  1 10:02:49 2013
+++ new/usr/src/cmd/prstat/prstat.h	Sat Jun  1 10:02:49 2013
@@ -20,6 +20,8 @@
  */
 
 /*
+ * Copyright (c) 2013 Gary Mills
+ *
  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  *
@@ -73,6 +75,7 @@
 #define	OPT_UDATE	0x20000		/* print unix timestamp */
 #define	OPT_DDATE	0x40000		/* print timestamp in date(1) format */
 #define	OPT_NORESOLVE	0x80000		/* no nsswitch lookups */
+#define	OPT_TRUNC	0x100000	/* truncate long names */
 
 /*
  * Flags to keep track of process or lwp status
--- old/usr/src/cmd/prstat/prtable.c	Sat Jun  1 10:02:49 2013
+++ new/usr/src/cmd/prstat/prtable.c	Sat Jun  1 10:02:49 2013
@@ -19,6 +19,8 @@
  * CDDL HEADER END
  */
 /*
+ * Copyright (c) 2013 Gary Mills
+ *
  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  *
@@ -59,14 +61,26 @@
 }
 
 void
-pwd_getname(uid_t uid, char *name, int length, int noresolve)
+pwd_getname(uid_t uid, char *name, size_t length, int noresolve,
+    int trunc, size_t width)
 {
 	struct passwd *pwd;
+	size_t n;
 
 	if (noresolve || (pwd = getpwuid(uid)) == NULL) {
-		(void) snprintf(name, length, "%u", uid);
+		n = snprintf(NULL, 0, "%u", uid);
+		if (trunc && n > width)
+			(void) snprintf(name, length, "%.*u%c",
+			    width - 1, uid, '*');
+		else
+			(void) snprintf(name, length, "%u", uid);
 	} else {
-		(void) snprintf(name, length, "%s", pwd->pw_name);
+		n = strlen(pwd->pw_name);
+		if (trunc && n > width)
+			(void) snprintf(name, length, "%.*s%c",
+			    width - 1, pwd->pw_name, '*');
+		else
+			(void) snprintf(name, length, "%s", pwd->pw_name);
 	}
 }
 
--- old/usr/src/cmd/prstat/prtable.h	Sat Jun  1 10:02:49 2013
+++ new/usr/src/cmd/prstat/prtable.h	Sat Jun  1 10:02:49 2013
@@ -19,6 +19,8 @@
  * CDDL HEADER END
  */
 /*
+ * Copyright (c) 2013 Gary Mills
+ *
  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  *
@@ -70,7 +72,7 @@
 	struct plwp	*l_next;
 } plwp_t;
 
-extern void pwd_getname(uid_t, char *, int, int);
+extern void pwd_getname(uid_t, char *, size_t, int, int, size_t);
 extern void add_uid(uidtbl_t *, char *);
 extern int has_uid(uidtbl_t *, uid_t);
 extern void add_element(table_t *, long);
--- old/usr/src/cmd/prstat/prutil.c	Sat Jun  1 10:02:49 2013
+++ new/usr/src/cmd/prstat/prutil.c	Sat Jun  1 10:02:49 2013
@@ -19,6 +19,8 @@
  * CDDL HEADER END
  */
 /*
+ * Copyright (c) 2013 Gary Mills
+ *
  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  *
@@ -106,7 +108,7 @@
 Usage()
 {
 	(void) fprintf(stderr, gettext(
-	    "Usage:\tprstat [-acHJLmrRtTvZ] [-u euidlist] [-U uidlist]\n"
+	    "Usage:\tprstat [-acHJLmrRtTvWZ] [-u euidlist] [-U uidlist]\n"
 	    "\t[-p pidlist] [-P cpulist] [-C psrsetlist] [-h lgrouplist]\n"
 	    "\t[-j projidlist] [-k taskidlist] [-z zoneidlist]\n"
 	    "\t[-s key | -S key] [-n nprocs[,nusers]] [-d d|u]\n"
@@ -278,26 +280,41 @@
 }
 
 void
-getprojname(projid_t projid, char *str, int len, int noresolve)
+getprojname(projid_t projid, char *str, size_t len, int noresolve,
+    int trunc, size_t width)
 {
 	struct project proj;
+	size_t n;
 
 	if (noresolve || getprojbyid(projid, &proj, projbuf, PROJECT_BUFSZ) ==
-	    NULL)
+	    NULL) {
 		(void) snprintf(str, len, "%-6d", (int)projid);
-	else
-		(void) snprintf(str, len, "%-28s", proj.pj_name);
+	} else {
+		n = strlen(proj.pj_name);
+		if (trunc && n > width)
+			(void) snprintf(str, len, "%.*s%c", width - 1,
+			    proj.pj_name, '*');
+		else
+			(void) snprintf(str, len, "%-28s", proj.pj_name);
+	}
 }
 
 void
-getzonename(zoneid_t zoneid, char *str, int len)
+getzonename(zoneid_t zoneid, char *str, size_t len, int trunc, size_t width)
 {
 	char zone_name[ZONENAME_MAX];
+	size_t n;
 
-	if (getzonenamebyid(zoneid, zone_name, sizeof (zone_name)) < 0)
+	if (getzonenamebyid(zoneid, zone_name, sizeof (zone_name)) < 0) {
 		(void) snprintf(str, len, "%-6d", (int)zoneid);
-	else
-		(void) snprintf(str, len, "%-28s", zone_name);
+	} else {
+		n = strlen(zone_name);
+		if (trunc && n > width)
+			(void) snprintf(str, len, "%.*s%c", width - 1,
+			    zone_name, '*');
+		else
+			(void) snprintf(str, len, "%-28s", zone_name);
+	}
 }
 
 /*
--- old/usr/src/cmd/prstat/prutil.h	Sat Jun  1 10:02:49 2013
+++ new/usr/src/cmd/prstat/prutil.h	Sat Jun  1 10:02:49 2013
@@ -19,6 +19,8 @@
  * CDDL HEADER END
  */
 /*
+ * Copyright (c) 2013 Gary Mills
+ *
  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  *
@@ -50,8 +52,8 @@
 extern void *Zalloc(size_t);
 extern int Setrlimit();
 extern void Priocntl(char *);
-extern void getprojname(projid_t, char *, int, int);
-extern void getzonename(projid_t, char *, int);
+extern void getprojname(projid_t, char *, size_t, int, int, size_t);
+extern void getzonename(projid_t, char *, size_t, int, size_t);
 extern void stripfname(char *);
 
 #ifdef	__cplusplus
--- old/usr/src/cmd/ps/ps.c	Sat Jun  1 10:02:49 2013
+++ new/usr/src/cmd/ps/ps.c	Sat Jun  1 10:02:49 2013
@@ -20,6 +20,8 @@
  */
 
 /*
+ * Copyright (c) 2013 Gary Mills
+ *
  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
@@ -76,7 +78,8 @@
  */
 #define	ARGSIZ ZONENAME_MAX
 
-#define	MAXUGNAME 10	/* max chars in a user/group name or printed u/g id */
+#define	MAXUGNAME (LOGNAME_MAX+2)	/* max chars in a user/group */
+						/* name or printed u/g id */
 
 /* Structure for storing user or group info */
 struct ugdata {
@@ -224,6 +227,7 @@
 static	int	dflg;
 static	int	Lflg;
 static	int	Pflg;
+static	int	Wflg;
 static	int	yflg;
 static	int	pflg;
 static	int	fflg;
@@ -424,7 +428,7 @@
 
 	fname[F_STIME].width = fname[F_STIME].minwidth = len;
 
-	while ((c = getopt(argc, argv, "jlfceAadLPyZHh:t:p:g:u:U:G:n:s:o:z:"))
+	while ((c = getopt(argc, argv, "jlfceAadLPWyZHh:t:p:g:u:U:G:n:s:o:z:"))
 	    != EOF)
 		switch (c) {
 		case 'H':		/* Show home lgroups */
@@ -518,6 +522,9 @@
 		case 'P':	/* show bound processor */
 			Pflg++;
 			break;
+		case 'W':	/* truncate long names */
+			Wflg++;
+			break;
 		case 'y':	/* omit F & ADDR, report RSS & SZ in Kby */
 			yflg++;
 			break;
@@ -1057,7 +1064,7 @@
 	int pos = 80, i = 0;
 
 	static char usage1[] =
-	    "ps [ -aAdefHlcjLPyZ ] [ -o format ] [ -t termlist ]";
+	    "ps [ -aAdefHlcjLPWyZ ] [ -o format ] [ -t termlist ]";
 	static char usage2[] =
 	    "\t[ -u userlist ] [ -U userlist ] [ -G grouplist ]";
 	static char usage3[] =
@@ -1395,19 +1402,40 @@
 	if (Zflg) {						/* ZONE */
 		if (getzonenamebyid(psinfo->pr_zoneid, zonename,
 		    sizeof (zonename)) < 0) {
-			(void) printf(" %7.7d ", ((int)psinfo->pr_zoneid));
+			if (snprintf(NULL, 0, "%d",
+			    ((int)psinfo->pr_zoneid)) > 7)
+				(void) printf(" %6.6d%c ",
+				    ((int)psinfo->pr_zoneid), '*');
+			else
+				(void) printf(" %7.7d ",
+				    ((int)psinfo->pr_zoneid));
 		} else {
-			(void) printf("%8.8s ", zonename);
+			if (strlen(zonename) > 8)
+				(void) printf("%7.7s%c ", zonename, '*');
+			else
+				(void) printf("%8.8s ", zonename);
 		}
 	}
 
 	if (fflg) {						/* UID */
-		if ((pwd = getpwuid(psinfo->pr_euid)) != NULL)
-			(void) printf("%8.8s ", pwd->pw_name);
-		else
-			(void) printf(" %7.7u ", psinfo->pr_euid);
+		if ((pwd = getpwuid(psinfo->pr_euid)) != NULL) {
+			if (strlen(pwd->pw_name) > 8)
+				(void) printf("%7.7s%c ", pwd->pw_name, '*');
+			else
+				(void) printf("%8.8s ", pwd->pw_name);
+		} else {
+			if (snprintf(NULL, 0, "%u",
+			    ((int)psinfo->pr_euid)) > 7)
+				(void) printf(" %6.6u%c ", psinfo->pr_euid,
+				    '*');
+			else
+				(void) printf(" %7.7u ", psinfo->pr_euid);
+		}
 	} else if (lflg) {
-		(void) printf("%6u ", psinfo->pr_euid);
+		if (snprintf(NULL, 0, "%u", ((int)psinfo->pr_euid)) > 6)
+			(void) printf("%5.5u%c ", psinfo->pr_euid, '*');
+		else
+			(void) printf("%6u ", psinfo->pr_euid);
 	}
 	(void) printf("%*d", pidwidth, (int)psinfo->pr_pid); /* PID */
 	if (lflg || fflg)
@@ -1628,16 +1656,38 @@
 
 	switch (f->fname) {
 	case F_RUSER:
-		if ((pwd = getpwuid(psinfo->pr_uid)) != NULL)
-			(void) printf("%*s", width, pwd->pw_name);
-		else
-			(void) printf("%*u", width, psinfo->pr_uid);
+		if ((pwd = getpwuid(psinfo->pr_uid)) != NULL) {
+			if (Wflg && strlen(pwd->pw_name) > width)
+				(void) printf("%.*s%c", width - 1,
+				    pwd->pw_name, '*');
+			else
+				(void) printf("%*s", width, pwd->pw_name);
+		} else {
+			if (Wflg && snprintf(NULL, 0, "%u",
+			    ((int)psinfo->pr_uid)) > width)
+
+				(void) printf("%*u%c", width - 1,
+				    psinfo->pr_uid, '*');
+			else
+				(void) printf("%*u", width, psinfo->pr_uid);
+		}
 		break;
 	case F_USER:
-		if ((pwd = getpwuid(psinfo->pr_euid)) != NULL)
-			(void) printf("%*s", width, pwd->pw_name);
-		else
-			(void) printf("%*u", width, psinfo->pr_euid);
+		if ((pwd = getpwuid(psinfo->pr_euid)) != NULL) {
+			if (Wflg && strlen(pwd->pw_name) > width)
+				(void) printf("%.*s%c", width - 1,
+				    pwd->pw_name, '*');
+			else
+				(void) printf("%*s", width, pwd->pw_name);
+		} else {
+			if (Wflg && snprintf(NULL, 0, "%u",
+			    ((int)psinfo->pr_euid)) > width)
+
+				(void) printf("%*u%c", width - 1,
+				    psinfo->pr_euid, '*');
+			else
+				(void) printf("%*u", width, psinfo->pr_euid);
+		}
 		break;
 	case F_RGROUP:
 		if ((grp = getgrgid(psinfo->pr_gid)) != NULL)
@@ -1879,13 +1929,24 @@
 			char proj_buf[PROJECT_BUFSZ];
 
 			if ((getprojbyid(psinfo->pr_projid, &cproj,
-			    (void *)&proj_buf, PROJECT_BUFSZ)) == NULL)
-				(void) printf("%*d", width,
-				    (int)psinfo->pr_projid);
-			else
-				(void) printf("%*s", width,
-				    (cproj.pj_name != NULL) ?
-				    cproj.pj_name : "---");
+			    (void *)&proj_buf, PROJECT_BUFSZ)) == NULL) {
+				if (Wflg && snprintf(NULL, 0, "%d",
+				    ((int)psinfo->pr_projid)) > width)
+					(void) printf("%.*d%c", width - 1,
+					    ((int)psinfo->pr_projid), '*');
+				else
+					(void) printf("%*d", width,
+					    (int)psinfo->pr_projid);
+			} else {
+				if (Wflg && cproj.pj_name != NULL &&
+				    strlen(cproj.pj_name) > width)
+					(void) printf("%.*s%c", width - 1,
+					    cproj.pj_name, '*');
+				else
+					(void) printf("%*s", width,
+					    (cproj.pj_name != NULL) ?
+					    cproj.pj_name : "---");
+			}
 		}
 		break;
 	case F_PSET:
@@ -1903,10 +1964,19 @@
 
 			if (getzonenamebyid(psinfo->pr_zoneid, zonename,
 			    sizeof (zonename)) < 0) {
-				(void) printf("%*d", width,
-				    ((int)psinfo->pr_zoneid));
+				if (Wflg && snprintf(NULL, 0, "%d",
+				    ((int)psinfo->pr_zoneid)) > width)
+					(void) printf("%.*d%c", width - 1,
+					    ((int)psinfo->pr_zoneid), '*');
+				else
+					(void) printf("%*d", width,
+					    (int)psinfo->pr_zoneid);
 			} else {
-				(void) printf("%*s", width, zonename);
+				if (Wflg && strlen(zonename) > width)
+					(void) printf("%.*s%c", width - 1,
+					    zonename, '*');
+				else
+					(void) printf("%*s", width, zonename);
 			}
 		}
 		break;
@@ -2181,9 +2251,18 @@
 	if (Zflg) {
 		if (getzonenamebyid(psinfo->pr_zoneid, zonename,
 		    sizeof (zonename)) < 0) {
-			(void) printf(" %7.7d ", ((int)psinfo->pr_zoneid));
+			if (snprintf(NULL, 0, "%d",
+			    ((int)psinfo->pr_zoneid)) > 7)
+				(void) printf(" %6.6d%c ",
+				    ((int)psinfo->pr_zoneid), '*');
+			else
+				(void) printf(" %7.7d ",
+				    ((int)psinfo->pr_zoneid));
 		} else {
-			(void) printf("%8.8s ", zonename);
+			if (strlen(zonename) > 8)
+				(void) printf("%7.7s%c ", zonename, '*');
+			else
+				(void) printf("%8.8s ", zonename);
 		}
 	}
 	if (Hflg) {
@@ -2191,12 +2270,25 @@
 		(void) printf(" %6d", (int)psinfo->pr_lwp.pr_lgrp); /* LGRP */
 	}
 	if (fflg) {
-		if ((pwd = getpwuid(psinfo->pr_euid)) != NULL)
-			(void) printf("%8.8s ", pwd->pw_name);
+		if ((pwd = getpwuid(psinfo->pr_euid)) != NULL) {
+			if (strlen(pwd->pw_name) > 8)
+				(void) printf("%7.7s%c ", pwd->pw_name, '*');
+			else
+				(void) printf("%8.8s ", pwd->pw_name);
+		} else {
+			if (snprintf(NULL, 0, "%u",
+			    ((int)psinfo->pr_euid)) > 7)
+				(void) printf(" %6.6u%c ", psinfo->pr_euid,
+				    '*');
+			else
+				(void) printf(" %7.7u ", psinfo->pr_euid);
+		}
+	} else if (lflg) {
+		if (snprintf(NULL, 0, "%u", ((int)psinfo->pr_euid)) > 6)
+			(void) printf("%5.5u%c ", psinfo->pr_euid, '*');
 		else
-			(void) printf(" %7.7u ", psinfo->pr_euid);
-	} else if (lflg)
-		(void) printf("%6u ", psinfo->pr_euid);
+			(void) printf("%6u ", psinfo->pr_euid);
+	}
 
 	(void) printf("%*d", pidwidth, (int)psinfo->pr_pid);	/* PID */
 	if (lflg || fflg)
--- old/usr/src/cmd/pwck/pwck.c	Sat Jun  1 10:02:49 2013
+++ new/usr/src/cmd/pwck/pwck.c	Sat Jun  1 10:02:49 2013
@@ -19,6 +19,8 @@
  * CDDL HEADER END
  */
 /*
+ * Copyright (c) 2013 Gary Mills
+ *
  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
@@ -27,8 +29,6 @@
 /*	  All Rights Reserved  	*/
 
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 #include <sys/types.h>
 #include <sys/param.h>
 #include <sys/signal.h>
@@ -41,6 +41,7 @@
 #include <locale.h>
 #include <errno.h>
 #include <unistd.h>
+#include <limits.h>
 
 #define	ERROR1	"Too many/few fields"
 #define	ERROR2	"Bad character(s) in logname"
@@ -149,9 +150,9 @@
 
 		for (i = 0; buf[i] != ':'; i++) {
 			if (!isalnum(buf[i]) &&
-				buf[i] != '_' &&
-				buf[i] != '-' &&
-				buf[i] != '.')
+			    buf[i] != '_' &&
+			    buf[i] != '-' &&
+			    buf[i] != '.')
 				badc++;
 			else if (islower(buf[i]))
 				lc++;
@@ -163,7 +164,7 @@
 
 		/* Check for valid number of characters in logname */
 
-		if (i <= 0 || i > 8)
+		if (i <= 0 || i > LOGNAME_MAX)
 			error(ERROR3);
 
 		/* Check that UID is numeric and <= MAXUID */
--- old/usr/src/cmd/sgs/Makefile	Sat Jun  1 10:02:49 2013
+++ new/usr/src/cmd/sgs/Makefile	Sat Jun  1 10:02:49 2013
@@ -18,6 +18,7 @@
 #
 # CDDL HEADER END
 #
+# Copyright (c) 2013 Gary Mills
 #
 # Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
 #
@@ -44,6 +45,7 @@
 		libcrle		\
 		.WAIT		\
 		0@0		\
+		getloginx	\
 		ld		\
 		ldd		\
 		lddstub		\
--- /dev/null	Sat Jun  1 10:02:49 2013
+++ new/usr/src/cmd/sgs/getloginx/Makefile	Sat Jun  1 10:02:49 2013
@@ -0,0 +1,28 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License, Version 1.0 only
+# (the "License").  You may not use this file except in compliance
+# with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright (c) 2013 Gary Mills
+#
+# Copyright (c) 1996 by Sun Microsystems, Inc.
+# All rights reserved.
+
+include		$(SRC)/cmd/sgs/Makefile.sub
--- /dev/null	Sat Jun  1 10:02:49 2013
+++ new/usr/src/cmd/sgs/getloginx/Makefile.com	Sat Jun  1 10:02:49 2013
@@ -0,0 +1,44 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 2013 Gary Mills
+#
+# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+#
+
+LIBRARY=	getloginx.a
+VERS=		.1
+
+OBJECTS=	getloginx.o
+
+include 	$(SRC)/lib/Makefile.lib
+
+MAPFILES=	../common/mapfile-vers
+LDLIBS +=	-lc
+BUILD.SO=       $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(LDLIBS)
+
+SRCS=		$(OBJECTS:%.o=../common/%.c)
+
+CLEANFILES +=	$(LINTOUT)
+CLOBBERFILES +=	$(DYNLIB)
+
+ROOTDYNLIB=	$(DYNLIB:%=$(ROOTLIBDIR)/%)
--- /dev/null	Sat Jun  1 10:02:49 2013
+++ new/usr/src/cmd/sgs/getloginx/Makefile.targ	Sat Jun  1 10:02:49 2013
@@ -0,0 +1,41 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright (c) 2013 Gary Mills
+#
+# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+
+pics/%.o:	../common/%.c
+		$(COMPILE.c) -o $@ $<
+		$(POST_PROCESS_O)
+
+all:		$(DYNLIB)
+
+$(DYNLIB):	pics .WAIT
+
+include		$(SRC)/lib/Makefile.targ
+
+delete:
+		$(RM) $(DYNLIB)
+
+lint:		lintcheck
--- /dev/null	Sat Jun  1 10:02:49 2013
+++ new/usr/src/cmd/sgs/getloginx/amd64/Makefile	Sat Jun  1 10:02:50 2013
@@ -0,0 +1,39 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License, Version 1.0 only
+# (the "License").  You may not use this file except in compliance
+# with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 2013 Gary Mills
+#
+# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+#
+
+include		$(SRC)/cmd/sgs/getloginx/Makefile.com
+
+ASFLAGS +=	-D__amd64 $(amd64_ASFLAGS)
+
+.KEEP_STATE:
+
+install:	all $(ROOTLIBDIR64)/$(DYNLIB)
+
+include		$(SRC)/cmd/sgs/getloginx/Makefile.targ
+include		../../Makefile.sub.64
+
--- /dev/null	Sat Jun  1 10:02:50 2013
+++ new/usr/src/cmd/sgs/getloginx/common/getloginx.c	Sat Jun  1 10:02:50 2013
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License, Version 1.0 only
+ * (the "License").  You may not use this file except in compliance
+ * with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ *	Copyright (c) 2013 Gary Mills
+ *
+ *	Copyright (c) 1996 by Sun Microsystems, Inc.
+ *
+ * Truncate a long login name returned by getlogin()
+ * for programs that copy the name to a nine-byte buffer.
+ *
+ * Use:
+ *	LD_PRELOAD=getloginx.so.1 program args ...
+ *
+ */
+
+extern char *getloginx(void);
+
+char *
+getlogin(void)
+{
+	return (getloginx());
+}
+
+/* */
--- /dev/null	Sat Jun  1 10:02:50 2013
+++ new/usr/src/cmd/sgs/getloginx/common/mapfile-vers	Sat Jun  1 10:02:50 2013
@@ -0,0 +1,47 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright (c) 2013 Gary Mills
+#
+
+#
+# MAPFILE HEADER START
+#
+# WARNING:  STOP NOW.  DO NOT MODIFY THIS FILE.
+# Object versioning must comply with the rules detailed in
+#
+#	usr/src/lib/README.mapfiles
+#
+# You should not be making modifications here until you've read the most current
+# copy of that file. If you need help, contact a gatekeeper for guidance.
+#
+# MAPFILE HEADER END
+#
+
+$mapfile_version 2
+
+SYMBOL_VERSION ILLUMOS_0.1 {	# first release of getloginx.so.1
+    global:
+	getlogin;
+    local:
+	*;
+};
+
--- /dev/null	Sat Jun  1 10:02:50 2013
+++ new/usr/src/cmd/sgs/getloginx/i386/Makefile	Sat Jun  1 10:02:50 2013
@@ -0,0 +1,35 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License, Version 1.0 only
+# (the "License").  You may not use this file except in compliance
+# with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 2013 Gary Mills
+#
+# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+
+include		$(SRC)/cmd/sgs/getloginx/Makefile.com
+
+.KEEP_STATE:
+
+include		$(SRC)/cmd/sgs/getloginx/Makefile.targ
+
+install:	all $(ROOTDYNLIB)
+
--- /dev/null	Sat Jun  1 10:02:50 2013
+++ new/usr/src/cmd/sgs/getloginx/sparc/Makefile	Sat Jun  1 10:02:50 2013
@@ -0,0 +1,35 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License, Version 1.0 only
+# (the "License").  You may not use this file except in compliance
+# with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 2013 Gary Mills
+#
+# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+
+include		$(SRC)/cmd/sgs/getloginx/Makefile.com
+
+.KEEP_STATE:
+
+include		$(SRC)/cmd/sgs/getloginx/Makefile.targ
+
+install:	all $(ROOTDYNLIB)
+
--- /dev/null	Sat Jun  1 10:02:50 2013
+++ new/usr/src/cmd/sgs/getloginx/sparcv9/Makefile	Sat Jun  1 10:02:50 2013
@@ -0,0 +1,36 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License, Version 1.0 only
+# (the "License").  You may not use this file except in compliance
+# with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 2013 Gary Mills
+#
+# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+
+include		$(SRC)/cmd/sgs/getloginx/Makefile.com
+
+.KEEP_STATE:
+
+install:	all $(ROOTLIBDIR64)/$(DYNLIB)
+
+include		$(SRC)/cmd/sgs/getloginx/Makefile.targ
+include		../../Makefile.sub.64
+
--- old/usr/src/cmd/w/w.c	Sat Jun  1 10:02:50 2013
+++ new/usr/src/cmd/w/w.c	Sat Jun  1 10:02:50 2013
@@ -19,6 +19,8 @@
  * CDDL HEADER END
  */
 /*
+ * Copyright (c) 2013 Gary Mills
+ *
  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
@@ -69,20 +71,16 @@
 #include <priv_utils.h>
 
 /*
- * utmpx defines wider fields for user and line.  For compatibility of output,
- * we are limiting these to the old maximums in utmp. Define UTMPX_NAMELEN
- * to use the full lengths.
+ * Use the full lengths from utmpx for user and line.
  */
-#ifndef UTMPX_NAMELEN
-/* XXX - utmp - fix name length */
-#define	NMAX		(_POSIX_LOGIN_NAME_MAX - 1)
-#define	LMAX		12
-#else	/* UTMPX_NAMELEN */
 static struct utmpx dummy;
 #define	NMAX		(sizeof (dummy.ut_user))
 #define	LMAX		(sizeof (dummy.ut_line))
-#endif /* UTMPX_NAMELEN */
 
+/* Print minimum field widths. */
+#define	LOGIN_WIDTH	8
+#define	LINE_WIDTH	12
+
 #define	DIV60(t)	((t+30)/60)	/* x/60 rounded */
 
 #ifdef ERR
@@ -483,17 +481,18 @@
 			continue;	/* we're looking for somebody else */
 
 		/* print login name of the user */
-		PRINTF(("%-*.*s ", NMAX, NMAX, ut->ut_name));
+		PRINTF(("%-*.*s ", LOGIN_WIDTH, NMAX, ut->ut_name));
 
 		/* print tty user is on */
 		if (lflag) {
-			PRINTF(("%-*.*s", LMAX, LMAX, ut->ut_line));
+			PRINTF(("%-*.*s", LINE_WIDTH, LMAX, ut->ut_line));
 		} else {
 			if (ut->ut_line[0] == 'p' && ut->ut_line[1] == 't' &&
 			    ut->ut_line[2] == 's' && ut->ut_line[3] == '/') {
 				PRINTF(("%-*.3s", LMAX, &ut->ut_line[4]));
 			} else {
-				PRINTF(("%-*.*s", LMAX, LMAX, ut->ut_line));
+				PRINTF(("%-*.*s", LINE_WIDTH, LMAX,
+				    ut->ut_line));
 			}
 		}
 
--- old/usr/src/cmd/wall/wall.c	Sat Jun  1 10:02:50 2013
+++ new/usr/src/cmd/wall/wall.c	Sat Jun  1 10:02:50 2013
@@ -31,6 +31,8 @@
 
 /*
  * Copyright 2012 Joyent, Inc. All rights reserved.
+ *
+ * Copyright (c) 2013 Gary Mills
  */
 
 #include <signal.h>
@@ -60,18 +62,10 @@
 #include <sys/ctfs.h>
 
 /*
- * utmpx defines wider fields for user and line.  For compatibility of output,
- * we are limiting these to the old maximums in utmp. Define UTMPX_NAMELEN
- * to use the full lengths.
+ * Use the full lengths from utmpx for user and line.
  */
-#ifndef UTMPX_NAMELEN
-/* XXX - utmp -fix name length */
-#define	NMAX	(_POSIX_LOGIN_NAME_MAX - 1)
-#define	LMAX	12
-#else /* UTMPX_NAMELEN */
-#define	NMAX	(sizeof (((struct utmpx *)0)->ut_user)
-#define	LMAX	(sizeof (((struct utmpx *)0)->ut_line)
-#endif /* UTMPX_NAMELEN */
+#define	NMAX	(sizeof (((struct utmpx *)0)->ut_user))
+#define	LMAX	(sizeof (((struct utmpx *)0)->ut_line))
 
 static char	mesg[3000];
 static char	*infile;
@@ -82,7 +76,7 @@
 static char	systm[MAXNAMLEN+1];
 static time_t	tloc;
 static struct	utsname utsn;
-static char	who[9]	= "???";
+static char	who[NMAX+1]	= "???";
 static char	time_buf[50];
 #define	DATE_FMT	"%a %b %e %H:%M:%S"
 
@@ -226,7 +220,8 @@
 				    MAXNAMLEN + 1);
 				if (rsystm[0] != '\0') {
 					(void) strcpy(systm, rsystm);
-					(void) strncpy(rwho, who, 9);
+					(void) strncpy(rwho, who,
+					    sizeof (who));
 					(void) strcpy(line, "rpc.rwalld");
 				}
 			}
@@ -428,7 +423,7 @@
 		(void) fprintf(f, " to group %s", grpname);
 	(void) fprintf(f, "...\n");
 #ifdef DEBUG
-	(void) fprintf(f, "DEBUG: To %.8s on %s\n", p->ut_user, s);
+	(void) fprintf(f, "DEBUG: To %.*s on %s\n", NMAX, p->ut_user, s);
 #endif
 	i = strlen(mesg);
 	for (bp = mesg; --i >= 0; bp++) {
@@ -470,13 +465,12 @@
 chkgrp(char *name)
 {
 	int i;
-	char *p;
+	char user[NMAX + 1];
 
+	(void) strncpy(user, name, NMAX);
+	user[NMAX] = '\0';
 	for (i = 0; pgrp->gr_mem[i] && pgrp->gr_mem[i][0]; i++) {
-		for (p = name; *p && *p != ' '; p++)
-		;
-		*p = 0;
-		if (strncmp(name, pgrp->gr_mem[i], 8) == 0)
+		if (strcmp(user, pgrp->gr_mem[i]) == 0)
 			return (1);
 	}
 
--- old/usr/src/cmd/who/who.c	Sat Jun  1 10:02:50 2013
+++ new/usr/src/cmd/who/who.c	Sat Jun  1 10:02:50 2013
@@ -23,12 +23,12 @@
 
 
 /*
+ * Copyright (c) 2013 Gary Mills
+ *
  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 /*
  *	This program analyzes information found in /var/adm/utmpx
  *
@@ -100,19 +100,15 @@
 static struct	utmpx *utmpp;	/* pointer for getutxent()	*/
 
 /*
- * utmpx defines wider fields for user and line.  For compatibility of output,
- * we are limiting these to the old maximums in utmp. Define UTMPX_NAMELEN
- * to use the full lengths.
+ * Use the full lengths from utmpx for user and line.
  */
-#ifndef UTMPX_NAMELEN
-/* XXX - utmp - fix name length */
-#define	NMAX	(_POSIX_LOGIN_NAME_MAX - 1)
-#define	LMAX	12
-#else /* UTMPX_NAMELEN */
 #define	NMAX	(sizeof (utmpp->ut_user))
 #define	LMAX	(sizeof (utmpp->ut_line))
-#endif
 
+/* Print minimum field widths. */
+#define	LOGIN_WIDTH	8
+#define	LINE_WIDTH	12
+
 static char	comment[BUFSIZ]; /* holds inittab comment	*/
 static char	errmsg[BUFSIZ];	/* used in snprintf for errors	*/
 static int	fildes;		/* file descriptor for inittab	*/
@@ -168,7 +164,8 @@
 	/*
 	 *	Strip off path name of this command
 	 */
-	for (i = strlen(argv[0]); i >= 0 && argv[0][i] != '/'; --i);
+	for (i = strlen(argv[0]); i >= 0 && argv[0][i] != '/'; --i)
+		;
 	if (i >= 0)
 		argv[0] += i+1;
 	program = argv[0];
@@ -243,7 +240,7 @@
 			if (number < 1) {
 				(void) fprintf(stderr, gettext(
 				    "%s: Number of users per line must "
-					"be at least 1\n"), program);
+				    "be at least 1\n"), program);
 				exit(1);
 			}
 			break;
@@ -348,16 +345,16 @@
 		(void) fprintf(stderr, gettext("t\ttime changes\n"));
 		(void) fprintf(stderr, gettext(
 		    "T\tstatus of tty (+ writable, - not writable, "
-			"? hung)\n"));
+		    "? hung)\n"));
 		(void) fprintf(stderr, gettext("u\tuseful information\n"));
 		(void) fprintf(stderr,
 		    gettext("m\tinformation only about current terminal\n"));
 		(void) fprintf(stderr, gettext(
 		    "am i\tinformation about current terminal "
-			"(same as -m)\n"));
+		    "(same as -m)\n"));
 		(void) fprintf(stderr, gettext(
 		    "am I\tinformation about current terminal "
-			"(same as -m)\n"));
+		    "(same as -m)\n"));
 		exit(1);
 	}
 
@@ -393,7 +390,7 @@
 	 */
 	if (justme == 1 || (argc == 3 && strcmp(argv[1], "am") == 0 &&
 	    ((argv[2][0] == 'i' || argv[2][0] == 'I') &&
-		argv[2][1] == '\0'))) {
+	    argv[2][1] == '\0'))) {
 		justme = 1;
 		myname = nameval;
 		(void) cuserid(myname);
@@ -509,7 +506,7 @@
 		 */
 		if (((totlusrs - 1) % number) == 0 && totlusrs > 1)
 			(void) printf("\n");
-		(void) printf("%-*s ", NMAX, user);
+		(void) printf("%-*.*s ", LOGIN_WIDTH, NMAX, user);
 		return;
 	}
 
@@ -565,7 +562,8 @@
 	/*
 	 *	Print the TERSE portion of the output
 	 */
-	(void) printf("%-*s %c %-12s %s", NMAX, user, w, device, time_buf);
+	(void) printf("%-*.*s %c %-12s %s", LOGIN_WIDTH, NMAX, user,
+	    w, device, time_buf);
 
 	if (!terse) {
 		/*
@@ -626,7 +624,8 @@
 			 */
 			while ((rc = strncmp(utmpp->ut_id, iinit,
 			    strcspn(iinit, ":"))) != 0) {
-				for (; *iinit != '\n'; iinit++);
+				for (; *iinit != '\n'; iinit++)
+					;
 				iinit++;
 
 				/*
@@ -646,10 +645,12 @@
 				 *	We found our entry
 				 */
 				for (iinit++; *iinit != '#' &&
-					 *iinit != '\n'; iinit++);
+				    *iinit != '\n'; iinit++)
+					;
 				if (*iinit == '#') {
 					for (iinit++; *iinit == ' ' ||
-						 *iinit == '\t'; iinit++);
+					    *iinit == '\t'; iinit++)
+						;
 					for (rc = 0; *iinit != '\n'; iinit++)
 						comment[rc++] = *iinit;
 					comment[rc] = '\0';
@@ -733,7 +734,7 @@
 				if (strncmp(myname, utmpp->ut_user,
 				    sizeof (utmpp->ut_user)) == 0 &&
 				    strncmp(mytty, utmpp->ut_line,
-					sizeof (utmpp->ut_line)) == 0 &&
+				    sizeof (utmpp->ut_line)) == 0 &&
 				    utmpp->ut_type == USER_PROCESS) {
 					/*
 					 * we have have found ourselves
@@ -756,7 +757,8 @@
 #ifdef	XPG4
 				if (utmpp->ut_type == LOGIN_PROCESS) {
 					if ((utmpp->ut_line[0] == '\0') ||
-					(strcmp(utmpp->ut_user, "LOGIN") != 0))
+					    (strcmp(utmpp->ut_user,
+					    "LOGIN") != 0))
 						continue;
 				}
 #endif	/* XPG4 */
@@ -765,7 +767,7 @@
 		} else {
 			(void) fprintf(stderr,
 			    gettext("%s: Error --- entry has ut_type "
-				"of %d\n"), program, utmpp->ut_type);
+			    "of %d\n"), program, utmpp->ut_type);
 			(void) fprintf(stderr,
 			    gettext(" when maximum is %d\n"), UTMAXTYPE);
 		}
--- old/usr/src/cmd/whodo/whodo.c	Sat Jun  1 10:02:50 2013
+++ new/usr/src/cmd/whodo/whodo.c	Sat Jun  1 10:02:50 2013
@@ -19,6 +19,8 @@
  * CDDL HEADER END
  */
 /*
+ * Copyright (c) 2013 Gary Mills
+ *
  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
@@ -68,20 +70,15 @@
 #include <priv_utils.h>
 
 /*
- * utmpx defines wider fields for user and line.  For compatibility of output,
- * we are limiting these to the old maximums in utmp. Define UTMPX_NAMELEN
- * to use the full lengths.
+ * Use the full lengths from utmpx for user and line.
  */
-#ifndef UTMPX_NAMELEN
-/* XXX - utmp - fix name length */
-#define	NMAX		(_POSIX_LOGIN_NAME_MAX - 1)
-#define	LMAX		12
-#else /* UTMPX_NAMELEN */
-static struct utmpx dummy;
-#define	NMAX	(sizeof (dummy.ut_user))
-#define	LMAX	(sizeof (dummy.ut_line))
-#endif /* UTMPX_NAMELEN */
+#define	NMAX	(sizeof (((struct utmpx *)0)->ut_user))
+#define	LMAX	(sizeof (((struct utmpx *)0)->ut_line))
 
+/* Print minimum field widths. */
+#define	LOGIN_WIDTH	8
+#define	LINE_WIDTH	12
+
 #define	DIV60(t)	((t+30)/60)    /* x/60 rounded */
 
 #ifdef ERR
@@ -473,10 +470,12 @@
 			continue;	/* we're looking for somebody else */
 		if (lflag) {	/* -l flag format (w command) */
 			/* print login name of the user */
-			(void) printf("%-*.*s ", NMAX, NMAX, ut->ut_name);
+			(void) printf("%-*.*s ", LOGIN_WIDTH, (int)NMAX,
+			    ut->ut_name);
 
 			/* print tty user is on */
-			(void) printf("%-*.*s", LMAX, LMAX, ut->ut_line);
+			(void) printf("%-*.*s", LINE_WIDTH, (int)LMAX,
+			    ut->ut_line);
 
 			/* print when the user logged in */
 			tim = ut->ut_xtime;
@@ -494,8 +493,9 @@
 			tim = ut->ut_xtime;
 			tm = localtime(&tim);
 			(void) printf("\n%-*.*s %-*.*s %2.1d:%2.2d\n",
-			    LMAX, LMAX, ut->ut_line,
-			    NMAX, NMAX, ut->ut_name, tm->tm_hour, tm->tm_min);
+			    LINE_WIDTH, (int)LMAX, ut->ut_line,
+			    LOGIN_WIDTH, (int)NMAX, ut->ut_name, tm->tm_hour,
+			    tm->tm_min);
 			showproc(findhash((pid_t)ut->ut_pid));
 		}
 	}
@@ -520,10 +520,11 @@
 	/* print the data for this process */
 	if (up->p_state == ZOMBIE)
 		(void) printf("    %-*.*s %5d %4.1ld:%2.2ld %s\n",
-		    LMAX, LMAX, "  ?", (int)up->p_upid, 0L, 0L, "<defunct>");
+		    LINE_WIDTH, (int)LMAX, "  ?", (int)up->p_upid, 0L, 0L,
+		    "<defunct>");
 	else if (up->p_state != NONE) {
 		(void) printf("    %-*.*s %5d %4.1ld:%2.2ld %s\n",
-		    LMAX, LMAX, getty(up->p_ttyd), (int)up->p_upid,
+		    LINE_WIDTH, (int)LMAX, getty(up->p_ttyd), (int)up->p_upid,
 		    up->p_time / 60L, up->p_time % 60L,
 		    up->p_comm);
 	}
--- old/usr/src/head/limits.h	Sat Jun  1 10:02:50 2013
+++ new/usr/src/head/limits.h	Sat Jun  1 10:02:50 2013
@@ -20,6 +20,8 @@
  */
 
 /*
+ * Copyright (c) 2013 Gary Mills
+ *
  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
@@ -31,8 +33,6 @@
 #ifndef _LIMITS_H
 #define	_LIMITS_H
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"	/* SVr4.0 1.34  */
-
 #include <sys/feature_tests.h>
 #include <sys/isa_defs.h>
 #include <iso/limits_iso.h>
@@ -290,7 +290,16 @@
 
 #endif /* CLK_TCK */
 
+#ifdef	__USE_LEGACY_LOGNAME__
 #define	LOGNAME_MAX	8	/* max # of characters in a login name */
+#else	/* __USE_LEGACY_LOGNAME__ */
+#define	LOGNAME_MAX	32	/* max # of characters in a login name */
+				/* Increased for illumos */
+#endif	/* __USE_LEGACY_LOGNAME__ */
+#define	LOGIN_NAME_MAX	(LOGNAME_MAX + 1)	/* max buffer size */
+#define	LOGNAME_MAX_TRAD	8		/* traditional length */
+#define	LOGIN_NAME_MAX_TRAD	(LOGNAME_MAX_TRAD + 1)	/* and size */
+
 #define	TTYNAME_MAX	128	/* max # of characters in a tty name */
 
 #endif	/* if defined(__EXTENSIONS__) || (!defined(_STRICT_STDC) ... */
--- old/usr/src/head/stdlib.h	Sat Jun  1 10:02:50 2013
+++ new/usr/src/head/stdlib.h	Sat Jun  1 10:02:50 2013
@@ -20,6 +20,8 @@
  */
 
 /*
+ * Copyright (c) 2013 Gary Mills
+ *
  * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
  */
 
@@ -222,7 +224,20 @@
 extern char *qgcvt(long double, int, char *);
 extern char *getcwd(char *, size_t);
 extern const char *getexecname(void);
+
+#ifndef	__GETLOGIN_DEFINED	/* Avoid duplicate in unistd.h */
+#define	__GETLOGIN_DEFINED
+#ifndef	__USE_LEGACY_LOGNAME__
+#ifdef	__PRAGMA_REDEFINE_EXTNAME
+#pragma	redefine_extname getlogin getloginx
+#else	/* __PRAGMA_REDEFINE_EXTNAME */
+extern char *getloginx(void);
+#define	getlogin	getloginx
+#endif	/* __PRAGMA_REDEFINE_EXTNAME */
+#endif	/* __USE_LEGACY_LOGNAME__ */
 extern char *getlogin(void);
+#endif	/* __GETLOGIN_DEFINED */
+
 extern int getopt(int, char *const *, const char *);
 extern char *optarg;
 extern int optind, opterr, optopt;
@@ -329,7 +344,20 @@
 extern char *qgcvt();
 extern char *getcwd();
 extern char *getexecname();
+
+#ifndef	__GETLOGIN_DEFINED	/* Avoid duplicate in unistd.h */
+#define	__GETLOGIN_DEFINED
+#ifndef	__USE_LEGACY_LOGNAME__
+#ifdef	__PRAGMA_REDEFINE_EXTNAME
+#pragma	redefine_extname getlogin getloginx
+#else	/* __PRAGMA_REDEFINE_EXTNAME */
+extern char *getloginx();
+#define	getlogin	getloginx
+#endif	/* __PRAGMA_REDEFINE_EXTNAME */
+#endif	/* __USE_LEGACY_LOGNAME__ */
 extern char *getlogin();
+#endif	/* __GETLOGIN_DEFINED */
+
 extern int getopt();
 extern char *optarg;
 extern int optind, opterr, optopt;
--- old/usr/src/head/unistd.h	Sat Jun  1 10:02:50 2013
+++ new/usr/src/head/unistd.h	Sat Jun  1 10:02:50 2013
@@ -20,6 +20,8 @@
  */
 
 /*
+ * Copyright (c) 2013 Gary Mills
+ *
  * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
  */
 
@@ -347,7 +349,20 @@
 #elif  !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
 extern int gethostname(char *, int);
 #endif
+
+#ifndef	__GETLOGIN_DEFINED	/* Avoid duplicate in stdlib.h */
+#define	__GETLOGIN_DEFINED
+#ifndef	__USE_LEGACY_LOGNAME__
+#ifdef	__PRAGMA_REDEFINE_EXTNAME
+#pragma	redefine_extname getlogin getloginx
+#else	/* __PRAGMA_REDEFINE_EXTNAME */
+extern char *getloginx(void);
+#define	getlogin	getloginx
+#endif	/* __PRAGMA_REDEFINE_EXTNAME */
+#endif	/* __USE_LEGACY_LOGNAME__ */
 extern char *getlogin(void);
+#endif	/* __GETLOGIN_DEFINED */
+
 #if defined(_XPG4) || defined(__EXTENSIONS__)
 extern int  getopt(int, char *const *, const char *);
 extern char *optarg;
@@ -668,7 +683,20 @@
 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
 extern int gethostname();
 #endif
+
+#ifndef __GETLOGIN_DEFINED	/* Avoid duplicate in stdlib.h */
+#define	__GETLOGIN_DEFINED
+#ifndef __USE_LEGACY_LOGNAME__
+#ifdef __PRAGMA_REDEFINE_EXTNAME
+#pragma	redefine_extname getlogin	getloginx
+#else	/* __PRAGMA_REDEFINE_EXTNAME */
+extern char *getloginx();
+#define	getlogin	getloginx
+#endif	/* __PRAGMA_REDEFINE_EXTNAME */
+#endif	/* __USE_LEGACY_LOGNAME__ */
 extern char *getlogin();
+#endif	/* __GETLOGIN_DEFINED */
+
 #if defined(_XPG4) || defined(__EXTENSIONS__)
 extern int  getopt();
 extern char *optarg;
@@ -926,20 +954,24 @@
 
 #if	(_POSIX_C_SOURCE - 0 >= 199506L) || defined(_POSIX_PTHREAD_SEMANTICS)
 
+#ifndef	__USE_LEGACY_LOGNAME__
+#ifdef	__PRAGMA_REDEFINE_EXTNAME
+#pragma	redefine_extname getlogin_r __posix_getloginx_r
+extern int getlogin_r(char *, int);
+#else	/* __PRAGMA_REDEFINE_EXTNAME */
+extern int __posix_getloginx_r(char *, int);
+#define	getlogin_r	__posix_getloginx_r
+#endif	/* __PRAGMA_REDEFINE_EXTNAME */
+#else	/* __USE_LEGACY_LOGNAME__ */
 #ifdef __PRAGMA_REDEFINE_EXTNAME
 #pragma redefine_extname getlogin_r __posix_getlogin_r
-#pragma redefine_extname ttyname_r __posix_ttyname_r
 extern int getlogin_r(char *, int);
-extern int ttyname_r(int, char *, size_t);
 #else  /* __PRAGMA_REDEFINE_EXTNAME */
-
 extern int __posix_getlogin_r(char *, int);
-extern int __posix_ttyname_r(int, char *, size_t);
 
 #ifdef __lint
 
 #define	getlogin_r	__posix_getlogin_r
-#define	ttyname_r	__posix_ttyname_r
 
 #else /* !__lint */
 
@@ -949,6 +981,24 @@
 	return (__posix_getlogin_r(__name, __len));
 }
 static int
+
+#endif /* !__lint */
+#endif /* __PRAGMA_REDEFINE_EXTNAME */
+#endif	/* __USE_LEGACY_LOGNAME__ */
+
+#ifdef __PRAGMA_REDEFINE_EXTNAME
+#pragma redefine_extname ttyname_r __posix_ttyname_r
+extern int ttyname_r(int, char *, size_t);
+#else  /* __PRAGMA_REDEFINE_EXTNAME */
+extern int __posix_ttyname_r(int, char *, size_t);
+
+#ifdef __lint
+
+#define	ttyname_r	__posix_ttyname_r
+
+#else /* !__lint */
+
+static int
 ttyname_r(int __fildes, char *__buf, size_t __size)
 {
 	return (__posix_ttyname_r(__fildes, __buf, __size));
@@ -959,7 +1009,16 @@
 
 #else  /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
 
+#ifndef	__USE_LEGACY_LOGNAME__
+#ifdef	__PRAGMA_REDEFINE_EXTNAME
+#pragma	redefine_extname getlogin_r getloginx_r
+#else	/* __PRAGMA_REDEFINE_EXTNAME */
+extern char *getloginx_r(char *, int);
+#define	getlogin_r	getloginx_r
+#endif	/* __PRAGMA_REDEFINE_EXTNAME */
+#endif	/* __USE_LEGACY_LOGNAME__ */
 extern char *getlogin_r(char *, int);
+
 extern char *ttyname_r(int, char *, int);
 
 #endif /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
@@ -968,20 +1027,24 @@
 
 #if (_POSIX_C_SOURCE - 0 >= 199506L) || defined(_POSIX_PTHREAD_SEMANTICS)
 
+#ifndef	__USE_LEGACY_LOGNAME__
+#ifdef	__PRAGMA_REDEFINE_EXTNAME
+#pragma	redefine_extname getlogin_r __posix_getloginx_r
+extern int getlogin_r();
+#else	/* __PRAGMA_REDEFINE_EXTNAME */
+extern int __posix_getloginx_r();
+#define	getlogin_r	__posix_getloginx_r
+#endif	/* __PRAGMA_REDEFINE_EXTNAME */
+#else	/* __USE_LEGACY_LOGNAME__ */
 #ifdef __PRAGMA_REDEFINE_EXTNAME
 #pragma redefine_extname getlogin_r __posix_getlogin_r
-#pragma redefine_extname ttyname_r __posix_ttyname_r
 extern int getlogin_r();
-extern int ttyname_r();
 #else  /* __PRAGMA_REDEFINE_EXTNAME */
-
 extern int __posix_getlogin_r();
-extern int __posix_ttyname_r();
 
 #ifdef	__lint
 
 #define	getlogin_r	__posix_getlogin_r
-#define	ttyname_r	__posix_ttyname_r
 
 #else /* !__lint */
 
@@ -992,7 +1055,23 @@
 {
 	return (__posix_getlogin_r(__name, __len));
 }
-static int
+#endif /* !__lint */
+#endif /* __PRAGMA_REDEFINE_EXTNAME */
+#endif	/* __USE_LEGACY_LOGNAME__ */
+
+#ifdef __PRAGMA_REDEFINE_EXTNAME
+#pragma redefine_extname ttyname_r __posix_ttyname_r
+extern int ttyname_r();
+#else  /* __PRAGMA_REDEFINE_EXTNAME */
+
+extern int __posix_ttyname_r();
+
+#ifdef	__lint
+
+#define	ttyname_r	__posix_ttyname_r
+
+#else /* !__lint */
+
 ttyname_r(__fildes, __buf, __size)
 	int __fildes;
 	char *__buf;
@@ -1005,7 +1084,16 @@
 
 #else  /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
 
+#ifndef __USE_LEGACY_LOGNAME__
+#ifdef __PRAGMA_REDEFINE_EXTNAME
+#pragma	redefine_extname getlogin_r	getloginx_r
+#else	/* __PRAGMA_REDEFINE_EXTNAME */
+extern char *getloginx_r();
+#define	getlogin_r	getloginx_r
+#endif	/* __PRAGMA_REDEFINE_EXTNAME */
+#endif	/* __USE_LEGACY_LOGNAME__ */
 extern char *getlogin_r();
+
 extern char *ttyname_r();
 
 #endif /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
--- old/usr/src/lib/libc/port/gen/getlogin.c	Sat Jun  1 10:02:50 2013
+++ new/usr/src/lib/libc/port/gen/getlogin.c	Sat Jun  1 10:02:50 2013
@@ -20,6 +20,8 @@
  */
 
 /*
+ * Copyright (c) 2013 Gary Mills
+ *
  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
@@ -27,11 +29,9 @@
 /*	Copyright (c) 1988 AT&T	*/
 /*	  All Rights Reserved  	*/
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
+#pragma weak _getlogin = getloginx
+#pragma weak _getlogin_r = getloginx_r
 
-#pragma weak _getlogin = getlogin
-#pragma weak _getlogin_r = getlogin_r
-
 #include "lint.h"
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -47,28 +47,42 @@
 #include <mtlib.h>
 #include "tsd.h"
 
+/* Revert the renames done in unistd.h */
+#ifdef	__PRAGMA_REDEFINE_EXTNAME
+#pragma	redefine_extname	getlogint	getlogin
+#pragma	redefine_extname	getlogint_r	getlogin_r
+#pragma	redefine_extname	__posix_getlogint_r	__posix_getlogin_r
+#else	/* __PRAGMA_REDEFINE_EXTNAME */
+#ifdef	getlogin
+#undef	getlogin
+#endif	/* getlogin */
+#ifdef	getlogin_r
+#undef	getlogin_r
+#endif	/* getlogin_r */
+#ifdef	__posix_getlogin_r
+#undef	__posix_getlogin_r
+#endif	/* __posix_getlogin_r */
+#define	getlogint	getlogin
+#define	getlogint_r	getlogin_r
+#define	__posix_getlogint_r	__posix_getlogin_r
+#endif	/* __PRAGMA_REDEFINE_EXTNAME */
+
 /*
- * XXX - _POSIX_LOGIN_NAME_MAX limits the length of a login name.  The utmpx
- * interface provides for a 32 character login name, but for the sake of
- * compatibility, we are still using the old utmp-imposed limit.
+ * Use the full length of a login name.
+ * The utmpx interface provides for a 32 character login name.
  */
+#define	NMAX	(sizeof (((struct utmpx *)0)->ut_user))
 
 /*
- * POSIX.1c Draft-6 version of the function getlogin_r.
- * It was implemented by Solaris 2.3.
+ * Common function
  */
-char *
-getlogin_r(char *answer, int namelen)
+static char *
+getl_r_common(char *answer, size_t namelen, size_t maxlen)
 {
 	int		uf;
 	off64_t		me;
 	struct futmpx	ubuf;
 
-	if (namelen < _POSIX_LOGIN_NAME_MAX) {
-		errno = ERANGE;
-		return (NULL);
-	}
-
 	if ((me = (off64_t)ttyslot()) < 0)
 		return (NULL);
 	if ((uf = open64(UTMPX_FILE, 0)) < 0)
@@ -81,24 +95,39 @@
 	(void) close(uf);
 	if (ubuf.ut_user[0] == '\0')
 		return (NULL);
-	(void) strncpy(&answer[0], &ubuf.ut_user[0],
-	    _POSIX_LOGIN_NAME_MAX - 1);
-	answer[_POSIX_LOGIN_NAME_MAX - 1] = '\0';
+
+	/* Insufficient buffer size */
+	if (namelen < strnlen(&ubuf.ut_user[0], maxlen)) {
+		errno = ERANGE;
+		return (NULL);
+	}
+	(void) strncpy(&answer[0], &ubuf.ut_user[0], maxlen);
+	answer[maxlen] = '\0';
 	return (&answer[0]);
 }
 
 /*
+ * POSIX.1c Draft-6 version of the function getlogin_r.
+ * It was implemented by Solaris 2.3.
+ */
+char *
+getlogint_r(char *answer, int namelen)
+{
+	return (getl_r_common(answer, (size_t)namelen, LOGNAME_MAX_TRAD));
+}
+
+/*
  * POSIX.1c standard version of the function getlogin_r.
  * User gets it via static getlogin_r from the header file.
  */
 int
-__posix_getlogin_r(char *name, int namelen)
+__posix_getlogint_r(char *name, int namelen)
 {
 	int nerrno = 0;
 	int oerrno = errno;
 
 	errno = 0;
-	if (getlogin_r(name, namelen) == NULL) {
+	if (getl_r_common(name, (size_t)namelen, LOGNAME_MAX_TRAD) == NULL) {
 		if (errno == 0)
 			nerrno = EINVAL;
 		else
@@ -109,11 +138,57 @@
 }
 
 char *
-getlogin(void)
+getlogint(void)
 {
-	char *answer = tsdalloc(_T_LOGIN, _POSIX_LOGIN_NAME_MAX, NULL);
+	char *answer = tsdalloc(_T_LOGIN, LOGIN_NAME_MAX_TRAD, NULL);
 
 	if (answer == NULL)
 		return (NULL);
-	return (getlogin_r(answer, _POSIX_LOGIN_NAME_MAX));
+	return (getl_r_common(answer, LOGIN_NAME_MAX_TRAD, LOGNAME_MAX_TRAD));
+}
+
+/*
+ * POSIX.1c Draft-6 version of the function getlogin_r.
+ * It was implemented by Solaris 2.3.
+ * For extended login names, selected by redefine_extname in unistd.h.
+ */
+char *
+getloginx_r(char *answer, int namelen)
+{
+	return (getl_r_common(answer, (size_t)namelen, NMAX));
+}
+
+/*
+ * POSIX.1c standard version of the function getlogin_r.
+ * User gets it via static getlogin_r from the header file.
+ * For extended login names, selected by redefine_extname in unistd.h.
+ */
+int
+__posix_getloginx_r(char *name, int namelen)
+{
+	int nerrno = 0;
+	int oerrno = errno;
+
+	errno = 0;
+	if (getl_r_common(name, (size_t)namelen, NMAX) == NULL) {
+		if (errno == 0)
+			nerrno = EINVAL;
+		else
+			nerrno = errno;
+	}
+	errno = oerrno;
+	return (nerrno);
+}
+
+/*
+ * For extended login names, selected by redefine_extname in unistd.h.
+ */
+char *
+getloginx(void)
+{
+	char *answer = tsdalloc(_T_LOGIN, LOGIN_NAME_MAX, NULL);
+
+	if (answer == NULL)
+		return (NULL);
+	return (getl_r_common(answer, LOGIN_NAME_MAX, NMAX));
 }
--- old/usr/src/lib/libc/port/gen/sysconf.c	Sat Jun  1 10:02:50 2013
+++ new/usr/src/lib/libc/port/gen/sysconf.c	Sat Jun  1 10:02:50 2013
@@ -20,6 +20,8 @@
  */
 
 /*
+ * Copyright (c) 2013 Gary Mills
+ *
  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
@@ -372,7 +374,7 @@
 			return ((long)NSS_BUFLEN_PASSWD);
 
 		case _SC_LOGIN_NAME_MAX:
-			return ((long)(LOGNAME_MAX + 1));
+			return ((long)(LOGIN_NAME_MAX));
 
 		case _SC_THREAD_KEYS_MAX:
 			return (-1L);
--- old/usr/src/lib/libc/port/llib-lc	Sat Jun  1 10:02:51 2013
+++ new/usr/src/lib/libc/port/llib-lc	Sat Jun  1 10:02:51 2013
@@ -22,6 +22,7 @@
 /*
  * Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
+ * Copyright (c) 2013 Gary Mills
  */
 
 /* LINTLIBRARY */
@@ -193,6 +194,7 @@
 char *__posix_ctime_r(const time_t *, char *);
 int __posix_ttyname_r(int, char *, size_t);
 int __posix_getlogin_r(char *, int);
+int __posix_getloginx_r(char *, int);
 
 /*
  * XPG4 versions of standard libc routines; these aren't extracted
@@ -474,7 +476,15 @@
 uint_t getisax(uint32_t *, uint_t);
 
 /* getlogin.c */
+char *getloginx(void);
+char *getloginx_r(char *, int);
+#ifdef	getlogin
+#undef	getlogin
+#endif	/* getlogin */
 char *getlogin(void);
+#ifdef	getlogin_r
+#undef	getlogin_r
+#endif	/* getlogin_r */
 char *getlogin_r(char *, int);
 
 /* getmntent.c */
--- old/usr/src/lib/libc/port/mapfile-vers	Sat Jun  1 10:02:51 2013
+++ new/usr/src/lib/libc/port/mapfile-vers	Sat Jun  1 10:02:51 2013
@@ -26,6 +26,8 @@
 #
 # Copyright (c) 2012 by Delphix. All rights reserved.
 #
+# Copyright (c) 2013 Gary Mills
+#
 
 #
 # MAPFILE HEADER START
@@ -2719,6 +2721,8 @@
 	_getfp;
 	_getgroupsbymember;
 	_getlogin_r;
+	getloginx;
+	getloginx_r;
 	_getsp;
 	__gettsp;
 	getvmusage;
@@ -2788,6 +2792,7 @@
 	__nthreads;
 	__openattrdirat;
 	option_to_attr;
+	__posix_getloginx_r;
 	__priv_bracket;
 	__priv_relinquish;
 	pset_assign_forced;
--- old/usr/src/man/man1/ps.1	Sat Jun  1 10:02:51 2013
+++ new/usr/src/man/man1/ps.1	Sat Jun  1 10:02:51 2013
@@ -2,6 +2,7 @@
 .\" Copyright 1989 AT&T
 .\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved
 .\" Copyright (c) 2012, Joyent, Inc. All Rights Reserved
+.\" Copyright (c) 2013 Gary Mills
 .\" Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved
 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at  http://www.opengroup.org/bookstore/.
 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text
@@ -11,13 +12,13 @@
 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
 .\"  See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with
 .\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH PS 1 "Aug 16, 2009"
+.TH PS 1 "Apr 16, 2013"
 .SH NAME
 ps \- report process status
 .SH SYNOPSIS
 .LP
 .nf
-\fBps\fR [\fB-aAcdefjHlLPyZ\fR] [\fB-g\fR \fIgrplist\fR] [\fB-h\fR \fIlgrplist\fR]
+\fBps\fR [\fB-aAcdefjHlLPWyZ\fR] [\fB-g\fR \fIgrplist\fR] [\fB-h\fR \fIlgrplist\fR]
      [\fB-n\fR \fInamelist\fR] [\fB-o\fR \fIformat\fR]... [\fB-p\fR \fIproclist\fR]
      [\fB-s\fR \fIsidlist\fR] [\fB-t\fR \fIterm\fR] [\fB-u\fR \fIuidlist\fR] [\fB-U\fR \fIuidlist\fR]
      [\fB-G\fR \fIgidlist\fR] [\fB-z\fR \fIzonelist\fR]
@@ -261,6 +262,18 @@
 .sp
 .ne 2
 .na
+\fB\fB-W\fR\fR
+.ad
+.RS 15n
+Truncate long names even when \fBps\fR would normally print them
+in full.
+A trailing asterisk marks a long name that has been truncated
+to fit the column.
+.RE
+
+.sp
+.ne 2
+.na
 \fB\fB-y\fR\fR
 .ad
 .RS 15n
@@ -405,6 +418,8 @@
 .RS 14n
 The effective user \fBID\fR number of the process (the login name is printed
 under the \fB-f\fR option).
+A trailing asterisk marks a long name that has been truncated
+to fit the column.
 .RE
 
 .sp
@@ -612,8 +627,9 @@
 line, and should be arranged in columns in the output. The field widths are
 selected by the system to be at least as wide as the header text (default or
 overridden value). If the header text is null, such as \fB-o\fR \fIuser=,\fR
-the field width is at least as wide as the default header text. If all header
-text fields are null, no header line is written.
+the field width is at least as wide as the default header text.
+Long names are not truncated in this mode.
+If all header text fields are null, no header line is written.
 .sp
 .LP
 The following names are recognized in the POSIX locale:
--- old/usr/src/man/man1m/prstat.1m	Sat Jun  1 10:02:51 2013
+++ new/usr/src/man/man1m/prstat.1m	Sat Jun  1 10:02:51 2013
@@ -1,18 +1,19 @@
 '\" te
+.\" Copyright (c) 2013 Gary Mills
 .\" Copyright (c) 2006, 2009 Sun Microsystems, Inc. All Rights Reserved.
 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
 .\"  See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with
 .\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH PRSTAT 1M "Jun 25, 2009"
+.TH PRSTAT 1M "Apr 15, 2013"
 .SH NAME
 prstat \- report active process statistics
 .SH SYNOPSIS
 .LP
 .nf
-\fBprstat\fR [\fB-acHJLmRrtTv\fR] [\fB-d\fR u | d] [\fB-C\fR \fIpsrsetlist\fR] [\fB-h\fR \fIlgrplist\fR]
+\fBprstat\fR [\fB-acHJLmRrtTvWZ\fR] [\fB-d\fR u | d] [\fB-C\fR \fIpsrsetlist\fR] [\fB-h\fR \fIlgrplist\fR]
      [\fB-j\fR \fIprojlist\fR] [\fB-k\fR \fItasklist\fR] [\fB-n\fR \fIntop\fR[,\fInbottom\fR]]
      [\fB-p\fR \fIpidlist\fR] [\fB-P\fR \fIcpulist\fR] [\fB-s\fR \fIkey\fR | \fB-S\fR \fIkey\fR ]
-     [\fB-u\fR \fIeuidlist\fR] [\fB-U\fR \fIuidlist\fR] [\fB-z\fR \fIzoneidlist\fR] [\fB-Z\fR]
+     [\fB-u\fR \fIeuidlist\fR] [\fB-U\fR \fIuidlist\fR] [\fB-z\fR \fIzoneidlist\fR]
      [\fIinterval\fR [\fIcount\fR]]
 .fi
 
@@ -56,6 +57,7 @@
 .sp .6
 .RS 4n
 Print new reports below previous reports instead of overprinting them.
+Long names are not truncated in this mode.
 .RE
 
 .sp
@@ -128,6 +130,8 @@
 .RS 4n
 Report information about processes and projects. In this mode \fBprstat\fR
 displays separate reports about processes and projects at the same time.
+A trailing asterisk marks a long name that has been truncated
+to fit the column.
 .RE
 
 .sp
@@ -364,6 +368,19 @@
 .sp
 .ne 2
 .na
+\fB\fB-W\fR\fR
+.ad
+.sp .6
+.RS 4n
+Truncate long names even when \fBprstat\fR would normally print them
+in full.
+A trailing asterisk marks a long name that has been truncated
+to fit the column.
+.RE
+
+.sp
+.ne 2
+.na
 \fB\fB-z\fR \fIzoneidlist\fR\fR
 .ad
 .sp .6
@@ -382,6 +399,8 @@
 .RS 4n
 Report information about processes and zones. In this mode, \fBprstat\fR
 displays separate reports about processes and zones at the same time.
+A trailing asterisk marks a long name that has been truncated
+to fit the column.
 .RE
 
 .SH OUTPUT
@@ -407,6 +426,8 @@
 .sp .6
 .RS 4n
 The real user (login) name or real user \fBID\fR.
+A trailing asterisk marks a long name that has been truncated
+to fit the column.
 .RE
 
 .sp
--- old/usr/src/man/man1m/useradd.1m	Sat Jun  1 10:02:51 2013
+++ new/usr/src/man/man1m/useradd.1m	Sat Jun  1 10:02:51 2013
@@ -1,10 +1,11 @@
 '\" te
+.\" Copyright (c) 2013 Gary Mills
 .\" Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
 .\" Copyright 1989 AT&T
 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH USERADD 1M "Feb 19, 2008"
+.TH USERADD 1M "Apr 16, 2013"
 .SH NAME
 useradd \- administer a new user login on the system
 .SH SYNOPSIS
@@ -59,6 +60,11 @@
 \fBuseradd\fR requires that usernames be in the format described in
 \fBpasswd\fR(4). A warning message is displayed if these restrictions are not
 met. See \fBpasswd\fR(4) for the requirements for usernames.
+.LP
+To change the action of \fBuseradd\fR when the traditional login name
+length limit of eight characters is exceeded, edit the file
+\fB/etc/default/useradd\fR by removing the \fB#\fR (pound sign) before the
+appropriate \fBEXCEED_TRAD=\fR entry, and adding it before the others.
 .SH OPTIONS
 .sp
 .LP
@@ -416,6 +422,9 @@
 .SH FILES
 .sp
 .LP
+\fB/etc/default/useradd\fR
+.sp
+.LP
 \fB/etc/datemsk\fR
 .sp
 .LP
--- old/usr/src/man/man3c/getlogin.3c	Sat Jun  1 10:02:51 2013
+++ new/usr/src/man/man3c/getlogin.3c	Sat Jun  1 10:02:51 2013
@@ -1,4 +1,5 @@
 '\" te
+.\" Copyright (c) 2013 Gary Mills
 .\" Copyright (c) 2004 Sun Microsystems, Inc.  All Rights Reserved.
 .\" Copyright 1989 AT&T
 .\" Portions Copyright (c) 1992, X/Open Company Limited.  All Rights Reserved.
@@ -9,7 +10,7 @@
 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH GETLOGIN 3C "May 18, 2004"
+.TH GETLOGIN 3C "May 25, 2013"
 .SH NAME
 getlogin, getlogin_r \- get login name
 .SH SYNOPSIS
@@ -42,6 +43,28 @@
 several login names.
 .sp
 .LP
+The login name plus the terminating null byte can be up to 33 characters
+in length.
+Newly-compiled programs should use the \fBLOGIN_NAME_MAX\fR symbol,
+defined in <\fBlimits.h\fR>, to size the buffer.
+Older programs that call \fBgetlogin()\fR  expect only the legacy
+9-character length.
+These automatically link to a version of the \fBgetlogin()\fR functions that
+truncates longer login names.
+It's also possible to compile new programs that link to truncating versions
+of these functions by defining \fB__USE_LEGACY_LOGNAME__\fR in the
+compile environment.
+.sp
+.LP
+Some older programs will correctly handle long login names returned
+by the \fBgetlogin()\fR function.
+For this case, the user compatibility library
+\fB/usr/lib/getloginx.so.1\fR redirects to a version of the \fBgetlogin()\fR
+function that returns the long name.
+This library should be added to such an application
+at runtime using \fBLD_PRELOAD\fR.
+.sp
+.LP
 If \fBgetlogin()\fR is called within a process that is not attached to a
 terminal, it returns a null pointer. The correct procedure for determining the
 login name is to call \fBcuserid\fR(3C), or to call \fBgetlogin()\fR and if it
@@ -51,7 +74,7 @@
 The \fBgetlogin_r()\fR function has the same functionality as \fBgetlogin()\fR
 except that the caller must supply a buffer \fIname\fR with length
 \fInamelen\fR to store the result.  The \fIname\fR buffer must be at least
-\fB_POSIX_LOGIN_NAME_MAX\fR bytes in size (defined in <\fBlimits.h\fR>). The
+\fBLOGIN_NAME_MAX\fR bytes in size (defined in <\fBlimits.h\fR>). The
 POSIX version (see \fBstandards\fR(5)) of \fBgetlogin_r()\fR takes a
 \fInamesize\fR parameter of type \fBsize_t\fR.
 .SH RETURN VALUES
@@ -151,6 +174,24 @@
 user access and administration information
 .RE
 
+.sp
+.ne 2
+.na
+\fB\fB/usr/lib/getloginx.so.1\fR\fR
+.ad
+.RS 18n
+A compatibility library that returns long login names to older applications.
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fB/usr/lib/64/getloginx.so.1\fR\fR
+.ad
+.RS 18n
+A 64-bit compatibility library to return long login names.
+.RE
+
 .SH ATTRIBUTES
 .sp
 .LP
--- old/usr/src/man/man3c/sysconf.3c	Sat Jun  1 10:02:51 2013
+++ new/usr/src/man/man3c/sysconf.3c	Sat Jun  1 10:02:51 2013
@@ -1,4 +1,5 @@
 '\" te
+.\" Copyright (c) 2013 Gary Mills
 .\" Copyright (c) 2008, Sun Microsystems, Inc.  All Rights Reserved.
 .\" Portions Copyright (c) 1992, X/Open Company Limited.  All Rights Reserved.
 .\" Copyright 1989 AT&T
@@ -9,7 +10,7 @@
 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH SYSCONF 3C "Mar 26, 2008"
+.TH SYSCONF 3C "Apr 16, 2013"
 .SH NAME
 sysconf \- get configurable system variables
 .SH SYNOPSIS
@@ -142,7 +143,7 @@
                                                    supported?
 _SC_LINE_MAX            LINE_MAX                   Max length of input
                                                    line
-_SC_LOGIN_NAME_MAX      LOGNAME_MAX + 1            Max length of login
+_SC_LOGIN_NAME_MAX      LOGIN_NAME_MAX             Max length of login
                                                    name
 _SC_LOGNAME_MAX         LOGNAME_MAX
 _SC_MAPPED_FILES        _POSIX_MAPPED_FILES        Supports Memory
--- old/usr/src/man/man4/passwd.4	Sat Jun  1 10:02:51 2013
+++ new/usr/src/man/man4/passwd.4	Sat Jun  1 10:02:51 2013
@@ -1,10 +1,11 @@
 '\" te
+.\" Copyright (c) 2013 Gary Mills
 .\" Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved.
 .\" Copyright 1989 AT&T
 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH PASSWD 4 "Jul 28, 2004"
+.TH PASSWD 4 "Apr 16, 2013"
 .SH NAME
 passwd \- password file
 .SH SYNOPSIS
@@ -47,7 +48,7 @@
 is the user's login name.
 .sp
 The login (\fBlogin\fR) and role (\fBrole\fR) fields accept a string of no more
-than eight bytes consisting of characters from the set of alphabetic
+than 32 bytes consisting of characters from the set of alphabetic
 characters, numeric characters, period (\fB\&.\fR), underscore (\fB_\fR), and
 hyphen (\fB-\fR). The first character should be alphabetic and the field should
 contain at least one lower case alphabetic character. A warning message is
--- old/usr/src/pkg/manifests/SUNWcs.mf	Sat Jun  1 10:02:51 2013
+++ new/usr/src/pkg/manifests/SUNWcs.mf	Sat Jun  1 10:02:51 2013
@@ -22,6 +22,7 @@
 #
 # Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
 # Copyright 2012 Nexenta Systems, Inc. All rights reserved.
+# Copyright (c) 2013 Gary Mills
 #
 
 <include SUNWcs.man1.inc>
@@ -346,6 +347,7 @@
 file path=etc/default/su group=sys preserve=true
 file path=etc/default/syslogd group=sys preserve=true
 file path=etc/default/tar group=sys preserve=true
+file path=etc/default/useradd group=sys preserve=true
 file path=etc/default/utmpd group=sys preserve=true
 file path=etc/dev/reserved_devnames group=sys preserve=true
 file path=etc/device.tab group=root mode=0444 preserve=true
--- old/usr/src/pkg/manifests/system-library.mf	Sat Jun  1 10:02:52 2013
+++ new/usr/src/pkg/manifests/system-library.mf	Sat Jun  1 10:02:52 2013
@@ -23,6 +23,7 @@
 # Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
 # Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
 # Copyright 2012 OmniTI Computer Consulting, Inc.  All rights reserved.
+# Copyright (c) 2013 Gary Mills
 #
 
 <include system-library.man3.inc>
@@ -316,6 +317,7 @@
 file path=lib/nss_nis.so.1
 file path=lib/nss_user.so.1
 file path=usr/lib/$(ARCH64)/0@0.so.1
+file path=usr/lib/$(ARCH64)/getloginx.so.1
 file path=usr/lib/$(ARCH64)/libadutils.so.1
 file path=usr/lib/$(ARCH64)/libast.so.1
 file path=usr/lib/$(ARCH64)/libbsdmalloc.so.1
@@ -382,6 +384,7 @@
 file path=usr/lib/cfgadm/shp.so.1
 file path=usr/lib/cfgadm/usb.so.1
 file path=usr/lib/extendedFILE.so.1
+file path=usr/lib/getloginx.so.1
 file path=usr/lib/lib.b mode=0444
 file path=usr/lib/libadutils.so.1
 file path=usr/lib/libast.so.1
