]> andersk Git - openssh.git/blobdiff - session.c
- (stevesk) [auth-pam.[ch] session.c] pam_getenvlist() must be
[openssh.git] / session.c
index 19b22c2aa1e2520b07b89a6cc089e6c2419d4893..3c759e4725c16a140a2698339480e9d515302e1e 100644 (file)
--- a/session.c
+++ b/session.c
@@ -1042,8 +1042,17 @@ do_setup_env(Session *s, const char *shell)
                    s->authctxt->krb5_ticket_file);
 #endif
 #ifdef USE_PAM
-       /* Pull in any environment variables that may have been set by PAM. */
-       copy_environment(fetch_pam_environment(), &env, &envsize);
+       /*
+        * Pull in any environment variables that may have
+        * been set by PAM.
+        */
+       {
+               char **p;
+
+               p = fetch_pam_environment();
+               copy_environment(p, &env, &envsize);
+               free_pam_environment(p);
+       }
 #endif /* USE_PAM */
 
        if (auth_sock_name != NULL)
@@ -1159,8 +1168,6 @@ do_nologin(struct passwd *pw)
 void
 do_setusercontext(struct passwd *pw)
 {
-       char tty='\0';
-
 #ifdef HAVE_CYGWIN
        if (is_winnt) {
 #else /* HAVE_CYGWIN */
@@ -1170,9 +1177,9 @@ do_setusercontext(struct passwd *pw)
                setpcred(pw->pw_name);
 #endif /* HAVE_SETPCRED */
 #ifdef HAVE_LOGIN_CAP
-#ifdef __bsdi__
+# ifdef __bsdi__
                setpgid(0, 0);
-#endif
+# endif
                if (setusercontext(lc, pw, pw->pw_uid,
                    (LOGIN_SETALL & ~LOGIN_SETPATH)) < 0) {
                        perror("unable to set user context");
@@ -1209,8 +1216,7 @@ do_setusercontext(struct passwd *pw)
                irix_setusercontext(pw);
 #  endif /* defined(WITH_IRIX_PROJECT) || defined(WITH_IRIX_JOBS) || defined(WITH_IRIX_ARRAY) */
 # ifdef _AIX
-               /* XXX: Disable tty setting.  Enabled if required later */
-               aix_usrinfo(pw, &tty, -1);
+               aix_usrinfo(pw);
 # endif /* _AIX */
                /* Permanently switch to the desired uid. */
                permanently_set_uid(pw);
This page took 0.037384 seconds and 4 git commands to generate.