From f095a8588237010852a3a85f971197a3a5b1d9ae Mon Sep 17 00:00:00 2001 From: Ben Lindstrom Date: Tue, 19 Feb 2002 20:02:48 +0000 Subject: - (bal) Migrate IRIX jobs/projects/audit/etc code to openbsd-compat/port-irix.[ch] to improve readiblity of do_child() --- session.c | 56 +++----------------------------------------------------- 1 file changed, 3 insertions(+), 53 deletions(-) (limited to 'session.c') diff --git a/session.c b/session.c index f9f5da80e..e48c3c0b4 100644 --- a/session.c +++ b/session.c @@ -57,16 +57,6 @@ RCSID("$OpenBSD: session.c,v 1.126 2002/02/14 23:28:00 markus Exp $"); #include "canohost.h" #include "session.h" -#ifdef WITH_IRIX_PROJECT -#include -#endif /* WITH_IRIX_PROJECT */ -#ifdef WITH_IRIX_JOBS -#include -#endif -#ifdef WITH_IRIX_AUDIT -#include -#endif /* WITH_IRIX_AUDIT */ - #if defined(HAVE_USERSEC_H) #include #endif @@ -1006,16 +996,6 @@ do_child(Session *s, const char *command) struct stat st; char *argv[10]; int do_xauth; -#ifdef WITH_IRIX_PROJECT - prid_t projid; -#endif /* WITH_IRIX_PROJECT */ -#ifdef WITH_IRIX_JOBS - jid_t jid = 0; -#else -#ifdef WITH_IRIX_ARRAY - int jid = 0; -#endif /* WITH_IRIX_ARRAY */ -#endif /* WITH_IRIX_JOBS */ do_xauth = s->display != NULL && s->auth_proto != NULL && s->auth_data != NULL; @@ -1098,39 +1078,9 @@ do_child(Session *s, const char *command) */ do_pam_setcred(0); # endif /* USE_PAM */ -# ifdef WITH_IRIX_JOBS - jid = jlimit_startjob(pw->pw_name, pw->pw_uid, "interactive"); - if (jid == -1) { - fatal("Failed to create job container: %.100s", - strerror(errno)); - } -# endif /* WITH_IRIX_JOBS */ -# ifdef WITH_IRIX_ARRAY - /* initialize array session */ - if (jid == 0) { - if (newarraysess() != 0) - fatal("Failed to set up new array session: %.100s", - strerror(errno)); - } -# endif /* WITH_IRIX_ARRAY */ -# ifdef WITH_IRIX_PROJECT - /* initialize irix project info */ - if ((projid = getdfltprojuser(pw->pw_name)) == -1) { - debug("Failed to get project id, using projid 0"); - projid = 0; - } - if (setprid(projid)) - fatal("Failed to initialize project %d for %s: %.100s", - (int)projid, pw->pw_name, strerror(errno)); -# endif /* WITH_IRIX_PROJECT */ -#ifdef WITH_IRIX_AUDIT - if (sysconf(_SC_AUDIT)) { - debug("Setting sat id to %d", (int) pw->pw_uid); - if (satsetid(pw->pw_uid)) - debug("error setting satid: %.100s", strerror(errno)); - } -#endif /* WITH_IRIX_AUDIT */ - +# if defined(WITH_IRIX_PROJECT) || defined(WITH_IRIX_JOBS) || defined(WITH_IRIX_ARRAY) + irix_setusercontext(pw); +# endif /* defined(WITH_IRIX_PROJECT) || defined(WITH_IRIX_JOBS) || defined(WITH_IRIX_ARRAY) */ #ifdef _AIX /* * AIX has a "usrinfo" area where logname and -- cgit v1.2.3