Print this page
11528 Makefile.noget can get gone
11529 Use -Wno-maybe-initialized

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/zlogin/zlogin.c
          +++ new/usr/src/cmd/zlogin/zlogin.c
↓ open down ↓ 15 lines elided ↑ open up ↑
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  23   23   * Copyright 2013 DEY Storage Systems, Inc.
  24   24   * Copyright (c) 2014 Gary Mills
  25   25   * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
       26 + * Copyright 2019 Joyent, Inc.
  26   27   */
  27   28  
  28   29  /*
  29   30   * zlogin provides three types of login which allow users in the global
  30   31   * zone to access non-global zones.
  31   32   *
  32   33   * - "interactive login" is similar to rlogin(1); for example, the user could
  33   34   *   issue 'zlogin my-zone' or 'zlogin -e ^ -l me my-zone'.   The user is
  34   35   *   granted a new pty (which is then shoved into the zone), and an I/O
  35   36   *   loop between parent and child processes takes care of the interactive
↓ open down ↓ 569 lines elided ↑ open up ↑
 605  606   * or an error is encountered, 1 if stdin is EOF, and 0 otherwise.
 606  607   */
 607  608  static int
 608  609  process_user_input(int outfd, int infd)
 609  610  {
 610  611          static boolean_t beginning_of_line = B_TRUE;
 611  612          static boolean_t local_echo = B_FALSE;
 612  613          char ibuf[ZLOGIN_BUFSIZ];
 613  614          int nbytes;
 614  615          char *buf = ibuf;
 615      -        char c = *buf;
 616  616  
 617  617          nbytes = read(STDIN_FILENO, ibuf, ZLOGIN_RDBUFSIZ);
 618  618          if (nbytes == -1 && (errno != EINTR || dead))
 619  619                  return (-1);
 620  620  
 621  621          if (nbytes == -1)       /* The read was interrupted. */
 622  622                  return (0);
 623  623  
 624  624          /* 0 read means EOF, close the pipe to the child */
 625  625          if (nbytes == 0)
 626  626                  return (1);
 627  627  
 628      -        for (c = *buf; nbytes > 0; c = *buf, --nbytes) {
      628 +        for (char c = *buf; nbytes > 0; c = *buf, --nbytes) {
 629  629                  buf++;
 630  630                  if (beginning_of_line && !nocmdchar) {
 631  631                          beginning_of_line = B_FALSE;
 632  632                          if (c == cmdchar) {
 633  633                                  local_echo = B_TRUE;
 634  634                                  continue;
 635  635                          }
 636  636                  } else if (local_echo) {
 637  637                          local_echo = B_FALSE;
 638  638                          if (c == '.' || c == effective_termios.c_cc[VEOF]) {
↓ open down ↓ 1652 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX