Print this page
Bring back LX zones.

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/zlogin/zlogin.c
          +++ new/usr/src/cmd/zlogin/zlogin.c
↓ open down ↓ 2183 lines elided ↑ open up ↑
2184 2184                  (void) dup2(slavefd, STDOUT_FILENO);
2185 2185                  (void) dup2(slavefd, STDERR_FILENO);
2186 2186                  if (slavefd != STDIN_FILENO && slavefd != STDOUT_FILENO &&
2187 2187                      slavefd != STDERR_FILENO) {
2188 2188                          (void) close(slavefd);
2189 2189                  }
2190 2190  
2191 2191                  /*
2192 2192                   * In failsafe mode, we don't use login(1), so don't try
2193 2193                   * setting up a utmpx entry.
2194      -                 */
2195      -                if (!failsafe)
     2194 +                 *
     2195 +                 * A branded zone may have very different utmpx semantics.
     2196 +                 * At the moment, we only have two brand types:
     2197 +                 * Solaris-like (native, sn1) and Linux.  In the Solaris
     2198 +                 * case, we know exactly how to do the necessary utmpx
     2199 +                 * setup.  Fortunately for us, the Linux /bin/login is
     2200 +                 * prepared to deal with a non-initialized utmpx entry, so
     2201 +                 * we can simply skip it.  If future brands don't fall into
     2202 +                 * either category, we'll have to add a per-brand utmpx
     2203 +                 * setup hook.
     2204 +                 */
     2205 +                if (!failsafe && (strcmp(zonebrand, "lx") != 0))
2196 2206                          if (setup_utmpx(slaveshortname) == -1)
2197 2207                                  return (1);
2198 2208  
2199 2209                  /*
2200 2210                   * The child needs to run as root to
2201 2211                   * execute the brand's login program.
2202 2212                   */
2203 2213                  if (setuid(0) == -1) {
2204 2214                          zperror(gettext("insufficient privilege"));
2205 2215                          return (1);
↓ open down ↓ 34 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX