summaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
Diffstat (limited to 'session.c')
-rw-r--r--session.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/session.c b/session.c
index 892810847..1e22f477f 100644
--- a/session.c
+++ b/session.c
@@ -28,6 +28,10 @@ RCSID("$OpenBSD: session.c,v 1.20 2000/06/18 04:42:54 markus Exp $");
28#include "auth.h" 28#include "auth.h"
29#include "auth-options.h" 29#include "auth-options.h"
30 30
31#ifdef WITH_IRIX_PROJECT
32#include <proj.h>
33#endif /* WITH_IRIX_PROJECT */
34
31/* types */ 35/* types */
32 36
33#define TTYSZ 64 37#define TTYSZ 64
@@ -799,6 +803,9 @@ do_child(const char *command, struct passwd * pw, const char *term,
799 extern char **environ; 803 extern char **environ;
800 struct stat st; 804 struct stat st;
801 char *argv[10]; 805 char *argv[10];
806#ifdef WITH_IRIX_PROJECT
807 prid_t projid;
808#endif /* WITH_IRIX_PROJECT */
802 809
803 /* login(1) is only called if we execute the login shell */ 810 /* login(1) is only called if we execute the login shell */
804 if (options.use_login && command != NULL) 811 if (options.use_login && command != NULL)
@@ -836,6 +843,25 @@ do_child(const char *command, struct passwd * pw, const char *term,
836 } 843 }
837 endgrent(); 844 endgrent();
838 845
846#ifdef WITH_IRIX_ARRAY
847 /* initialize array session */
848 if (newarraysess() != 0)
849 fatal("Failed to set up new array session: %.100s",
850 strerror(errno));
851#endif /* WITH_IRIX_ARRAY */
852
853#ifdef WITH_IRIX_PROJECT
854 /* initialize irix project info */
855 if ((projid = getdfltprojuser(pw->pw_name)) == -1) {
856 debug("Failed to get project id, using projid 0");
857 projid = 0;
858 }
859
860 if (setprid(projid))
861 fatal("Failed to initialize project %d for %s: %.100s",
862 (int)projid, pw->pw_name, strerror(errno));
863#endif /* WITH_IRIX_PROJECT */
864
839 /* Permanently switch to the desired uid. */ 865 /* Permanently switch to the desired uid. */
840 permanently_set_uid(pw->pw_uid); 866 permanently_set_uid(pw->pw_uid);
841 } 867 }