1 /* XXX - BSD license here */
5 #if defined(WITH_IRIX_PROJECT) || \
6 defined(WITH_IRIX_JOBS) || \
7 defined(WITH_IRIX_ARRAY)
9 #ifdef WITH_IRIX_PROJECT
11 #endif /* WITH_IRIX_PROJECT */
13 # include <sys/resource.h>
15 #ifdef WITH_IRIX_AUDIT
17 #endif /* WITH_IRIX_AUDIT */
20 irix_setusercontext(struct passwd *pw)
22 #ifdef WITH_IRIX_PROJECT
27 #elif defined(WITH_IRIX_ARRAY)
32 jid = jlimit_startjob(pw->pw_name, pw->pw_uid, "interactive");
34 fatal("Failed to create job container: %.100s",
36 #endif /* WITH_IRIX_JOBS */
37 #ifdef WITH_IRIX_ARRAY
38 /* initialize array session */
39 if (jid == 0 && newarraysess() != 0)
40 fatal("Failed to set up new array session: %.100s",
42 #endif /* WITH_IRIX_ARRAY */
43 #ifdef WITH_IRIX_PROJECT
44 /* initialize irix project info */
45 if ((projid = getdfltprojuser(pw->pw_name)) == -1) {
46 debug("Failed to get project id, using projid 0");
50 fatal("Failed to initialize project %d for %s: %.100s",
51 (int)projid, pw->pw_name, strerror(errno));
52 #endif /* WITH_IRIX_PROJECT */
53 #ifdef WITH_IRIX_AUDIT
54 if (sysconf(_SC_AUDIT)) {
55 debug("Setting sat id to %d", (int) pw->pw_uid);
56 if (satsetid(pw->pw_uid))
57 debug("error setting satid: %.100s", strerror(errno));
59 #endif /* WITH_IRIX_AUDIT */
63 #endif /* defined(WITH_IRIX_PROJECT) || defined(WITH_IRIX_JOBS) || defined(WITH_IRIX_ARRAY) */