Print this page
2989 Eliminate use of LOGNAME_MAX in ON
1166 useradd have warning with name more 8 chars

@@ -17,10 +17,12 @@
  * information: Portions Copyright [yyyy] [name of copyright owner]
  *
  * CDDL HEADER END
  */
 /*
+ * Copyright (c) 2013 Gary Mills
+ *
  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  */
 
 /*
  * zlogin provides three types of login which allow users in the global

@@ -86,10 +88,16 @@
 #include <libbrand.h>
 #include <auth_list.h>
 #include <auth_attr.h>
 #include <secdb.h>
 
+#ifdef  LOGNAME_MAX_ILLUMOS
+#define _LOGNAME_MAX    LOGNAME_MAX_ILLUMOS
+#else /* LOGNAME_MAX_ILLUMOS */
+#define _LOGNAME_MAX    LOGNAME_MAX
+#endif /* LOGNAME_MAX_ILLUMOS */
+
 static int masterfd;
 static struct termios save_termios;
 static struct termios effective_termios;
 static int save_fd;
 static struct winsize winsize;

@@ -1238,11 +1246,11 @@
 {
         size_t size;
         char **new_env;
         int e, i;
         char *estr;
-        char varmail[LOGNAME_MAX + 11]; /* strlen(/var/mail/) = 10, NUL */
+        char varmail[_LOGNAME_MAX + 11]; /* strlen(/var/mail/) = 10, NUL */
         char pwbuf[NSS_BUFLEN_PASSWD + 1];
         struct passwd pwent;
         struct passwd *pw = NULL;
 
         assert(env != NULL);