diff options
| author | Jerry Jelinek <jerry.jelinek@joyent.com> | 2019-12-19 12:40:51 +0000 |
|---|---|---|
| committer | Jerry Jelinek <jerry.jelinek@joyent.com> | 2019-12-19 12:40:51 +0000 |
| commit | 1b4b6f23c2256de6934b89b05c0a77a44b84f817 (patch) | |
| tree | 38a41ef900c089f777207f357f041d5814dfd532 /usr/src/cmd/zlogin | |
| parent | dfbd50d8db03bb9bc7350af3a750cd017d66d0c0 (diff) | |
| parent | 7b2eb3f3c068e560c7357b0f314172448bb8d1e0 (diff) | |
| download | illumos-joyent-1b4b6f23c2256de6934b89b05c0a77a44b84f817.tar.gz | |
[illumos-gate merge]
commit 7b2eb3f3c068e560c7357b0f314172448bb8d1e0
12057 Writing part of the string to stderr makes zlogin exit
commit d2dd27964b9dfc03118548f9509e4706787c2a69
12088 Cannot build iasl with bison 3.5 [-Werror=char-subscripts]
commit bf74bfd433cc5106d2fffc63678efb6ba4a3694c
12090 loader.efi: efi_readkey_ex needs to check the key despite the shift status or toggle status
commit 5947648b7f5c085635051e1f7aa083a309542467
12069 Backport sh_delay() and tvsleep() from ksh-2020.0.0
commit fc5c75cf5edb072564020725faa0c4313714f09f
12051 re-enable ZFS trim by default
commit 8b35e52344673c75ba6a446ced1fb5c36b52a242
12070 sata SSDs attached to sata ports can't trim
commit 2ed5f78a049996104f9dcce38d0c0c1735dd0e7a
12091 loader: biosdisk.c: Use symbolic names for int13 calls
commit bf6cb86ec437546144857d9aa94ef222ec6763c0
12082 libpctx: cast between incompatible function types
commit c94f4b0313ed735fc39e1b15e1fa48c0e6e3730f
12081 libldap5: cast between incompatible function types
commit 3c19a1689122901345a6089d081aa2de4a1096da
12079 audit_plugins: cast between incompatible function types
commit adbb29bd77dbfbbf129b5e3bd6ccc5bd4074fd79
12073 loader: devopen dereference after free
commit fdf04373777e703cebbbce0f774ae970eb6030f7
12072 loader: vdisk dereference after free
Diffstat (limited to 'usr/src/cmd/zlogin')
| -rw-r--r-- | usr/src/cmd/zlogin/zlogin.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/usr/src/cmd/zlogin/zlogin.c b/usr/src/cmd/zlogin/zlogin.c index 2c9d271abe..1b49fc221f 100644 --- a/usr/src/cmd/zlogin/zlogin.c +++ b/usr/src/cmd/zlogin/zlogin.c @@ -25,6 +25,7 @@ * Copyright 2016 Joyent, Inc. * Copyright 2015 Nexenta Systems, Inc. All rights reserved. * Copyright 2019 Joyent, Inc. + * Copyright 2019 OmniOS Community Edition (OmniOSce) Association. */ /* @@ -127,6 +128,8 @@ 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. @@ -833,8 +836,16 @@ process_output(int in_fd, int out_fd) cc = read(in_fd, ibuf, ZLOGIN_BUFSIZ); if (cc == -1 && (errno != EINTR || dead)) return (-1); - if (cc == 0) /* EOF */ - 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 == -1) /* The read was interrupted. */ return (0); @@ -854,10 +865,10 @@ process_output(int in_fd, int out_fd) /* * This is the main I/O loop, and is shared across all zlogin modes. * Parameters: - * stdin_fd: The fd representing 'stdin' for the slave side; input to + * stdin_fd: The fd representing 'stdin' for the slave side; input to * the zone will be written here. * - * appin_fd: The fd representing the other end of the 'stdin' pipe (when + * appin_fd: The fd representing the other end of the 'stdin' pipe (when * we're running non-interactive); used in process_raw_input * to ensure we don't fill up the application's stdin pipe. * |
