Print this page
12306 XPG4v2 slave pty behaviour should generally be disabled
Reviewed by: Robert Mustacchi <rm@fingolfin.org>
Change-ID: I7ccd399c22866f34dd20c6bb9d28e77ba4e24c67

@@ -22,11 +22,11 @@
  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2013 DEY Storage Systems, Inc.
  * Copyright (c) 2014 Gary Mills
  * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
  * Copyright 2019 Joyent, Inc.
- * Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
+ * Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
  */
 
 /*
  * zlogin provides three types of login which allow users in the global
  * zone to access non-global zones.

@@ -113,12 +113,10 @@
 static int pollerr = 0;
 
 static const char *pname;
 static char *username;
 
-extern int __xpg4;      /* 0 if not an xpg4/6-compiled program */
-
 /*
  * When forced_login is true, the user is not prompted
  * for an authentication password in the target zone.
  */
 static boolean_t forced_login = B_FALSE;

@@ -768,20 +766,12 @@
         char ibuf[ZLOGIN_BUFSIZ];
 
         cc = read(in_fd, ibuf, ZLOGIN_BUFSIZ);
         if (cc == -1 && (errno != EINTR || dead))
                 return (-1);
-        if (cc == 0) {
-                /*
-                 * A return value of 0 when calling read() on a terminal
-                 * indicates end-of-file pre-XPG4 and no data available
-                 * for XPG4 and above.
-                 */
-                if (__xpg4 == 0)
-                        return (-1);
-                return (0);
-        }
+        if (cc == 0)
+                return (-1);    /* EOF */
         if (cc == -1)   /* The read was interrupted. */
                 return (0);
 
         do {
                 int len;