Print this page
3913 there is no dialup, only zuul

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/halt/halt.c
          +++ new/usr/src/cmd/halt/halt.c
↓ open down ↓ 14 lines elided ↑ open up ↑
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  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 2010 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
  24   24   */
       25 +/*
       26 + * Copyright (c) 2013, Joyent, Inc. All rights reserved.
       27 + */
  25   28  
  26   29  /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
  27   30  /*        All Rights Reserved   */
  28   31  
  29   32  /*
  30   33   * University Copyright- Copyright (c) 1982, 1986, 1988
  31   34   * The Regents of the University of California
  32   35   * All Rights Reserved
  33   36   *
  34   37   * University Acknowledgment- Portions of this document are derived from
↓ open down ↓ 1209 lines elided ↑ open up ↑
1244 1247                  (void) fprintf(stderr, gettext("%s: WARNING, unable to start "
1245 1248                      "boot archive update\n"), cmdname);
1246 1249          else
1247 1250                  while (waitpid(pid, NULL, 0) == -1 && errno == EINTR)
1248 1251                          ;
1249 1252  }
1250 1253  
1251 1254  int
1252 1255  main(int argc, char *argv[])
1253 1256  {
1254      -        char *ttyn = ttyname(STDERR_FILENO);
1255      -
1256 1257          int qflag = 0, needlog = 1, nosync = 0;
1257 1258          int fast_reboot = 0;
1258 1259          int prom_reboot = 0;
1259 1260          uintptr_t mdep = NULL;
1260 1261          int cmd, fcn, c, aval, r;
1261 1262          const char *usage;
1262 1263          const char *optstring;
1263 1264          zoneid_t zoneid = getzoneid();
1264 1265          int need_check_zones = 0;
1265 1266          char bootargs_buf[BOOTARGS_MAX];
↓ open down ↓ 51 lines elided ↑ open up ↑
1317 1318                  case 'l':
1318 1319                          needlog = 0;
1319 1320                          break;
1320 1321                  case 'n':
1321 1322                          nosync = 1;
1322 1323                          break;
1323 1324                  case 'q':
1324 1325                          qflag = 1;
1325 1326                          break;
1326 1327                  case 'y':
1327      -                        ttyn = NULL;
     1328 +                        /*
     1329 +                         * Option ignored for backwards compatibility.
     1330 +                         */
1328 1331                          break;
1329 1332                  case 'f':
1330 1333                          fast_reboot = 1;
1331 1334                          break;
1332 1335                  case 'p':
1333 1336                          prom_reboot = 1;
1334 1337                          break;
1335 1338  #if defined(__i386)
1336 1339                  case 'e':
1337 1340                          bename = optarg;
↓ open down ↓ 103 lines elided ↑ open up ↑
1441 1444                   */
1442 1445                  if (strlen(bootargs_buf) != 0)
1443 1446                          mdep = (uintptr_t)bootargs_buf;
1444 1447          }
1445 1448  
1446 1449  #if 0   /* For debugging */
1447 1450          if (mdep != NULL)
1448 1451                  (void) fprintf(stderr, "mdep = %s\n", (char *)mdep);
1449 1452  #endif
1450 1453  
1451      -        if (fcn != AD_BOOT && ttyn != NULL &&
1452      -            strncmp(ttyn, "/dev/term/", strlen("/dev/term/")) == 0) {
1453      -                /*
1454      -                 * TRANSLATION_NOTE
1455      -                 * Don't translate ``halt -y''
1456      -                 */
1457      -                (void) fprintf(stderr,
1458      -                    gettext("%s: dangerous on a dialup;"), cmdname);
1459      -                (void) fprintf(stderr,
1460      -                    gettext("use ``%s -y'' if you are really sure\n"), cmdname);
1461      -                goto fail;
1462      -        }
1463      -
1464 1454          if (needlog) {
1465 1455                  char *user = getlogin();
1466 1456                  struct passwd *pw;
1467 1457                  char *tty;
1468 1458  
1469 1459                  openlog(cmdname, 0, LOG_AUTH);
1470 1460                  if (user == NULL && (pw = getpwuid(getuid())) != NULL)
1471 1461                          user = pw->pw_name;
1472 1462                  if (user == NULL)
1473 1463                          user = "root";
↓ open down ↓ 205 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX