Print this page
104 Bring back lx brand

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