Print this page
OS-4119 lxbrand panic when running native perl inside lx zone
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/exec/shbin/shbin.c
          +++ new/usr/src/uts/common/exec/shbin/shbin.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  /*
  23   23   * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
       25 + * Copyright 2015, Joyent, Inc.
  25   26   */
  26   27  
  27   28  #include <sys/types.h>
  28   29  #include <sys/param.h>
  29   30  #include <sys/sysmacros.h>
  30   31  #include <sys/signal.h>
  31   32  #include <sys/cred.h>
  32   33  #include <sys/user.h>
  33   34  #include <sys/errno.h>
  34   35  #include <sys/vnode.h>
↓ open down ↓ 16 lines elided ↑ open up ↑
  51   52  shbinexec(
  52   53          struct vnode *vp,
  53   54          struct execa *uap,
  54   55          struct uarg *args,
  55   56          struct intpdata *idatap,
  56   57          int level,
  57   58          long *execsz,
  58   59          int setid,
  59   60          caddr_t exec_file,
  60   61          struct cred *cred,
  61      -        int brand_action);
       62 +        int *brand_action);
  62   63  
  63   64  #define SHBIN_CNTL(x)   ((x)&037)
  64   65  #define SHBINMAGIC_LEN  4
  65   66  extern char shbinmagicstr[];
  66   67  
  67   68  /*
  68   69   * Our list where we may find a copy of ksh93. The ordering is:
  69   70   * 1. 64bit (may not be installed or not supported in hardware)
  70   71   * 2. 32bit
  71   72   * 3. Use /sbin/ksh93 when /usr is not available
↓ open down ↓ 83 lines elided ↑ open up ↑
 155  156  shbinexec(
 156  157          struct vnode *vp,
 157  158          struct execa *uap,
 158  159          struct uarg *args,
 159  160          struct intpdata *idatap,
 160  161          int level,
 161  162          long *execsz,
 162  163          int setid,
 163  164          caddr_t exec_file,
 164  165          struct cred *cred,
 165      -        int brand_action)
      166 +        int *brand_action)
 166  167  {
 167  168          _NOTE(ARGUNUSED(brand_action))
 168  169          vnode_t *nvp;
 169  170          int error = 0;
 170  171          struct intpdata idata;
 171  172          struct pathname intppn;
 172  173          struct pathname resolvepn;
 173  174          char *opath;
 174  175          char devfd[19]; /* 32-bit int fits in 10 digits + 8 for "/dev/fd/" */
 175  176          int fd = -1;
↓ open down ↓ 92 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX