Print this page
5110 want pam_timestamp module

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/su/su.c
          +++ new/usr/src/cmd/su/su.c
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  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 (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved.
  23   23   * Copyright 2012 Milan Jurik. All rights reserved.
       24 + * Copyright 2014 Nexenta Systems, Inc.
  24   25   */
  25   26  /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
  26   27  /*        All Rights Reserved   */
  27   28  
  28   29  /*      Copyright (c) 1987, 1988 Microsoft Corporation  */
  29   30  /*        All Rights Reserved   */
  30   31  
  31   32  /*
  32   33   *      su [-] [name [arg ...]] change userid, `-' changes environment.
  33   34   *      If SULOG is defined, all attempts to su to another user are
↓ open down ↓ 242 lines elided ↑ open up ↑
 276  277                      (S_IRUSR|S_IWUSR)));
 277  278                  (void) chown(Sulog, (uid_t)ROOT, (gid_t)ROOT);
 278  279          }
 279  280  
 280  281  #ifdef DYNAMIC_SU
 281  282          if (pam_start(embedded ? EMBEDDED_NAME : "su", nptr,
 282  283              embedded ? &emb_pam_conv : &pam_conv, &pamh) != PAM_SUCCESS)
 283  284                  exit(1);
 284  285          if (pam_set_item(pamh, PAM_TTY, ttyn) != PAM_SUCCESS)
 285  286                  exit(1);
      287 +        if (getpwuid_r(getuid(), &pwd, pwdbuf, sizeof (pwdbuf)) == NULL ||
      288 +            pam_set_item(pamh, PAM_AUSER, pwd.pw_name) != PAM_SUCCESS)
      289 +                exit(1);
 286  290  #endif  /* DYNAMIC_SU */
 287  291  
 288  292          openlog("su", LOG_CONS, LOG_AUTH);
 289  293  
 290  294  #ifdef DYNAMIC_SU
 291  295  
 292  296          /*
 293  297           * Use the same value of sleeptime and password required that
 294  298           * login(1) uses.
 295  299           * This is obtained by reading the file /etc/default/login
↓ open down ↓ 1257 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX