IRIX cleanup.

mouring mouring at etoh.eviladmin.org
Sat Feb 16 06:27:21 EST 2002


Can I get someone from the IRIX group to apply this patch to the
3.0.2pX release and reconfigure/compile.  I'm trying to clean out
do_child() in perparation of a larger patch to that part of the code.

Also if someone could give me the hint for the right compiler magic
to wrap the code in instead of what I'm doing now.  I'd be thankful.

Thanks

- Ben


diff -urN openssh-3.0.2p1/openbsd-compat/Makefile.in openssh-irix/openbsd-compat/Makefile.in
--- openssh-3.0.2p1/openbsd-compat/Makefile.in	Wed Sep 19 21:07:51 2001
+++ openssh-irix/openbsd-compat/Makefile.in	Thu Feb 14 22:50:17 2002
@@ -18,7 +18,7 @@

 OPENBSD=base64.o bindresvport.o daemon.o dirname.o getcwd.o getgrouplist.o getopt.o glob.o inet_aton.o inet_ntoa.o inet_ntop.o mktemp.o readpassphrase.o realpath.o rresvport.o setenv.o setproctitle.o sigact.o strlcat.o strlcpy.o strmode.o strsep.o

-COMPAT=bsd-arc4random.o bsd-cray.o bsd-cygwin_util.o bsd-misc.o bsd-nextstep.o bsd-snprintf.o bsd-waitpid.o fake-getaddrinfo.o fake-getnameinfo.o
+COMPAT=bsd-arc4random.o bsd-cray.o bsd-cygwin_util.o bsd-irix.o bsd-misc.o bsd-nextstep.o bsd-snprintf.o bsd-waitpid.o fake-getaddrinfo.o fake-getnameinfo.o

 .c.o:
 	$(CC) $(CFLAGS) $(CPPFLAGS) -c $<
diff -urN openssh-3.0.2p1/openbsd-compat/bsd-irix.c openssh-irix/openbsd-compat/bsd-irix.c
--- openssh-3.0.2p1/openbsd-compat/bsd-irix.c	Wed Dec 31 18:00:00 1969
+++ openssh-irix/openbsd-compat/bsd-irix.c	Thu Feb 14 23:08:00 2002
@@ -0,0 +1,61 @@
+#include "includes.h"
+
+#if defined(WITH_IRIX_PROJECT) || defined(WITH_IRIX_JOBS) || defined(WITH_IRIX_ARRAY)
+
+#ifdef WITH_IRIX_PROJECT
+#include <proj.h>
+#endif /* WITH_IRIX_PROJECT */
+#ifdef WITH_IRIX_JOBS
+#include <sys/resource.h>
+#endif
+#ifdef WITH_IRIX_AUDIT
+#include <sat.h>
+#endif /* WITH_IRIX_AUDIT */
+
+void
+irix_setusercontext(struct passwd *pw)
+{
+#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 */
+
+#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  && 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 */
+}
+
+
+#endif /* defined(WITH_IRIX_PROJECT) || defined(WITH_IRIX_JOBS) || defined(WITH_IRIX_ARRAY) */
diff -urN openssh-3.0.2p1/openbsd-compat/bsd-irix.h openssh-irix/openbsd-compat/bsd-irix.h
--- openssh-3.0.2p1/openbsd-compat/bsd-irix.h	Wed Dec 31 18:00:00 1969
+++ openssh-irix/openbsd-compat/bsd-irix.h	Thu Feb 14 23:06:23 2002
@@ -0,0 +1,5 @@
+#if defined(WITH_IRIX_PROJECT) || defined(WITH_IRIX_JOBS) || defined(WITH_IRIX_ARRAY)
+
+void irix_setusercontext(struct passwd *pw);
+
+#endif /* defined(WITH_IRIX_PROJECT) || defined(WITH_IRIX_JOBS) || defined(WITH_IRIX_ARRAY) */
diff -urN openssh-3.0.2p1/openbsd-compat/openbsd-compat.h openssh-irix/openbsd-compat/openbsd-compat.h
--- openssh-3.0.2p1/openbsd-compat/openbsd-compat.h	Wed Sep 19 21:07:51 2001
+++ openssh-irix/openbsd-compat/openbsd-compat.h	Thu Feb 14 22:56:33 2002
@@ -40,5 +40,6 @@

 /* Routines for a single OS platform */
 #include "bsd-cray.h"
+#include "bsd-irix.h"

 #endif /* _OPENBSD_H */
Binary files openssh-3.0.2p1/scard/Ssh.bin and openssh-irix/scard/Ssh.bin differ
diff -urN openssh-3.0.2p1/session.c openssh-irix/session.c
--- openssh-3.0.2p1/session.c	Sat Dec  1 17:37:08 2001
+++ openssh-irix/session.c	Thu Feb 14 23:07:31 2002
@@ -57,16 +57,6 @@
 #include "canohost.h"
 #include "session.h"

-#ifdef WITH_IRIX_PROJECT
-#include <proj.h>
-#endif /* WITH_IRIX_PROJECT */
-#ifdef WITH_IRIX_JOBS
-#include <sys/resource.h>
-#endif
-#ifdef WITH_IRIX_AUDIT
-#include <sat.h>
-#endif /* WITH_IRIX_AUDIT */
-
 #if defined(HAVE_USERSEC_H)
 #include <usersec.h>
 #endif
@@ -1038,16 +1028,6 @@
 	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;
@@ -1130,39 +1110,9 @@
 			 */
 			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




More information about the openssh-unix-dev mailing list