Print this page
5110 want pam_timestamp module

@@ -19,10 +19,11 @@
  * CDDL HEADER END
  */
 /*
  * Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2012 Milan Jurik. All rights reserved.
+ * Copyright 2014 Nexenta Systems, Inc.
  */
 /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
 /*        All Rights Reserved   */
 
 /*      Copyright (c) 1987, 1988 Microsoft Corporation  */

@@ -281,10 +282,13 @@
         if (pam_start(embedded ? EMBEDDED_NAME : "su", nptr,
             embedded ? &emb_pam_conv : &pam_conv, &pamh) != PAM_SUCCESS)
                 exit(1);
         if (pam_set_item(pamh, PAM_TTY, ttyn) != PAM_SUCCESS)
                 exit(1);
+        if (getpwuid_r(getuid(), &pwd, pwdbuf, sizeof (pwdbuf)) == NULL ||
+            pam_set_item(pamh, PAM_AUSER, pwd.pw_name) != PAM_SUCCESS)
+                exit(1);
 #endif  /* DYNAMIC_SU */
 
         openlog("su", LOG_CONS, LOG_AUTH);
 
 #ifdef DYNAMIC_SU