Print this page
OS-3280 need a way to specify the root of a native system in the lx brand
OS-3279 lx brand should allow delegated datasets
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libcurses/screen/setupterm.c
          +++ new/usr/src/lib/libcurses/screen/setupterm.c
↓ open down ↓ 29 lines elided ↑ open up ↑
  30   30  /*
  31   31   * University Copyright- Copyright (c) 1982, 1986, 1988
  32   32   * The Regents of the University of California
  33   33   * All Rights Reserved
  34   34   *
  35   35   * University Acknowledgment- Portions of this document are derived from
  36   36   * software developed by the University of California, Berkeley, and its
  37   37   * contributors.
  38   38   */
  39   39  
  40      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  41      -
  42   40  /*LINTLIBRARY*/
  43   41  
  44   42  #include        <stdio.h>
  45   43  #include        <sys/types.h>
  46   44  #include        <fcntl.h>
  47   45  #include        <stdlib.h>
  48   46  #include        <string.h>
  49   47  #include        <unistd.h>
  50   48  #include        <errno.h>
       49 +#include        <zone.h>
  51   50  #include        "curses_inc.h"
  52   51  
  53   52  #define TERMPATH        "/usr/share/lib/terminfo/"
  54   53  #define TERMPATHLEN     512
  55   54  
  56   55  extern  bool    _use_env;       /* in curses.c */
  57   56  
  58   57  chtype  bit_attributes[NUM_ATTRIBUTES] = {
  59   58              A_STANDOUT,
  60   59              A_UNDERLINE,
↓ open down ↓ 204 lines elided ↑ open up ↑
 265  264  
 266  265                  tfd = open(fname, 0);
 267  266  #ifdef  DUMPTI
 268  267                  printf("looking in file %s\n", fname);
 269  268  #endif  /* DUMPTI */
 270  269                  if ((tfd < 0) && (errno == EACCES))
 271  270                          goto cant_read;
 272  271          }
 273  272  
 274  273          if (tfd < 0) {
      274 +                const char *zroot = zone_get_nroot();
 275  275                  /* /usr/share/lib/terminfo/?/$TERM */
 276  276                  if (snprintf(fname, sizeof (fname),
 277      -                        "%s/%c/%s", TERMPATH, *term, term) >= sizeof (fname)) {
      277 +                        "%s/%s/%c/%s", zroot == NULL ? "" : zroot, TERMPATH,
      278 +                        *term, term) >= sizeof (fname)) {
 278  279                          term_errno = TERMINFO_TOO_LONG;
 279  280                          goto out_err;
 280  281                  }
 281  282  
 282  283                  tfd = open(fname, 0);
 283  284  #ifdef  DUMPTI
 284  285                  printf("looking in file %s\n", fname);
 285  286  #endif  /* DUMPTI */
 286  287  
 287  288          }
↓ open down ↓ 552 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX