[Bug 101] New: session.c modifications for correct UNICOS behavior

bugzilla-daemon at mindrot.org bugzilla-daemon at mindrot.org
Tue Feb 5 06:22:43 EST 2002


http://bugzilla.mindrot.org/show_bug.cgi?id=101

           Summary: session.c modifications for correct UNICOS behavior
           Product: Portable OpenSSH
           Version: 3.0.2p1
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: sshd
        AssignedTo: openssh-unix-dev at mindrot.org
        ReportedBy: wendyp at cray.com


--- session.c.orig      Mon Feb  4 12:32:52 2002
+++ session.c   Mon Feb  4 13:03:18 2002
@@ -67,6 +67,10 @@
 #include <sat.h>
 #endif /* WITH_IRIX_AUDIT */

+#ifdef _CRAY
+#include <tmpdir.h>
+#endif
+
 #if defined(HAVE_USERSEC_H)
 #include <usersec.h>
 #endif
@@ -494,11 +498,16 @@
                if (dup2(err[0], 2) < 0)        /* stderr */
                        perror("dup2 stderr");
 #endif /* USE_PIPES */
-
+#ifdef _CRAY
+               cray_init_job(s->pw); /* set up cray jid and tmpdir */
+#endif
                /* Do processing for the child (exec command etc). */
                do_child(s, command);
                /* NOTREACHED */
        }
+#ifdef _CRAY
+       signal(WJSIGNAL, cray_job_termination_handler);
+#endif /* _CRAY */
 #ifdef HAVE_CYGWIN
        if (is_winnt)
                cygwin_set_impersonation_token(INVALID_HANDLE_VALUE);
@@ -586,7 +595,12 @@
                /* record login, etc. similar to login(1) */
 #ifndef HAVE_OSF_SIA
                if (!(options.use_login && command == NULL))
+               {
+# ifdef _CRAY
+                       cray_init_job(s->pw); /* set up cray jid and tmpdir */
+# endif        /* _CRAY */
                        do_login(s, command);
+               }
 # ifdef LOGIN_NEEDS_UTMPX
                else
                        do_pre_login(s);
@@ -597,6 +611,9 @@
                do_child(s, command);
                /* NOTREACHED */
        }
+#ifdef _CRAY
+       signal(WJSIGNAL, cray_job_termination_handler);
+#endif /* _CRAY */
 #ifdef HAVE_CYGWIN
        if (is_winnt)
                cygwin_set_impersonation_token(INVALID_HANDLE_VALUE);
@@ -743,6 +760,7 @@
                printf("%s\n", aixloginmsg);
 #endif /* WITH_AIXAUTHENTICATE */

+#ifndef _CRAY
        if (options.print_lastlog && last_login_time != 0) {
                time_string = ctime(&last_login_time);
                if (strchr(time_string, '\n'))
@@ -752,6 +770,7 @@
                else
                        printf("Last login: %s from %s\r\n", time_string, hostna
me);
        }
+#endif /* ! _CRAY */

        do_motd();
 }
@@ -1027,16 +1046,17 @@
        if (options.use_login && command != NULL)
                options.use_login = 0;

-#if !defined(HAVE_OSF_SIA)
+#ifndef _CRAY
+# if !defined(HAVE_OSF_SIA)
        if (!options.use_login) {
-# ifdef HAVE_LOGIN_CAP
+#  ifdef HAVE_LOGIN_CAP
                if (!login_getcapbool(lc, "ignorenologin", 0) && pw->pw_uid)
                        f = fopen(login_getcapstr(lc, "nologin", _PATH_NOLOGIN,
                            _PATH_NOLOGIN), "r");
-# else /* HAVE_LOGIN_CAP */
+#  else /* HAVE_LOGIN_CAP */
                if (pw->pw_uid)
                        f = fopen(_PATH_NOLOGIN, "r");
-# endif /* HAVE_LOGIN_CAP */
+#  endif /* HAVE_LOGIN_CAP */
                if (f) {
                        /* /etc/nologin exists.  Print its contents and exit. */
                        while (fgets(buf, sizeof(buf), f))
@@ -1045,7 +1065,10 @@
                        exit(254);
                }
        }
-#endif /* HAVE_OSF_SIA */
+# endif /* HAVE_OSF_SIA */
+#else
+       cray_setup(pw->pw_uid, pw->pw_name, command);
+#endif /* _CRAY */

        /* Set login name, uid, gid, and groups. */
        /* Login(1) does this as well, and it needs uid 0 for the "-h"
@@ -1245,6 +1268,10 @@
        if (original_command)
                child_set_env(&env, &envsize, "SSH_ORIGINAL_COMMAND",
                    original_command);
+#ifdef _CRAY
+       if (cray_tmpdir[0] != '\0')
+               child_set_env(&env, &envsize, "TMPDIR", cray_tmpdir);
+#endif /* _CRAY */

 #ifdef _AIX
        if ((cp = getenv("AUTHSTATE")) != NULL)
@@ -1392,11 +1419,13 @@
                                    "%.100s %.100s %.100s\n",
                                    options.xauth_location, s->auth_display[0],
                                    s->auth_proto, s->auth_data);
+#ifndef _CRAY
                                if (s->auth_display[1])
                                        fprintf(stderr,
                                            "add %.100s %.100s %.100s\n",
                                            s->auth_display[1],
                                            s->auth_proto, s->auth_data);
+#endif /* _CRAY */
                        }
                        snprintf(cmd, sizeof cmd, "%s -q -",
                            options.xauth_location);
@@ -1405,10 +1434,12 @@
                                fprintf(f, "add %s %s %s\n",
                                    s->auth_display[0], s->auth_proto,
                                    s->auth_data);
+#ifndef _CRAY
                                if (s->auth_display[1])
                                        fprintf(f, "add %s %s %s\n",
                                            s->auth_display[1], s->auth_proto,
                                            s->auth_data);
+#endif /* _CRAY */
                                pclose(f);
                        } else {
                                fprintf(stderr, "Could not run %s\n",



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the openssh-unix-dev mailing list