summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-06-28 08:22:29 +1000
committerDamien Miller <djm@mindrot.org>2000-06-28 08:22:29 +1000
commit91606b17d2f8db5a1cbf32f7d780a6ac6f09bdd2 (patch)
tree381e5ef92c449e606a2475f09c9d454cede8f005
parent53c5d467c366122df252a7ffe599c1f2ded06370 (diff)
- (djm) Patch from Michael Stone <mstone@cs.loyola.edu> to add support for
Irix 6.x array sessions, project id's, and system audit trail id.
-rw-r--r--CREDITS1
-rw-r--r--ChangeLog2
-rw-r--r--acconfig.h9
-rw-r--r--configure.in4
-rw-r--r--session.c26
-rw-r--r--uidswap.c11
6 files changed, 52 insertions, 1 deletions
diff --git a/CREDITS b/CREDITS
index c472261a3..1774e2760 100644
--- a/CREDITS
+++ b/CREDITS
@@ -45,6 +45,7 @@ Kiyokazu SUTO <suto@ks-and-ks.ne.jp> - Bugfixes
45Lutz Jaenicke <Lutz.Jaenicke@aet.TU-Cottbus.DE> - Bugfixes 45Lutz Jaenicke <Lutz.Jaenicke@aet.TU-Cottbus.DE> - Bugfixes
46Marc G. Fournier <marc.fournier@acadiau.ca> - Solaris patches 46Marc G. Fournier <marc.fournier@acadiau.ca> - Solaris patches
47Matt Richards <v2matt@btv.ibm.com> - AIX patches 47Matt Richards <v2matt@btv.ibm.com> - AIX patches
48Michael Stone <mstone@cs.loyola.edu> - Irix enhancements
48Nalin Dahyabhai <nalin.dahyabhai@pobox.com> - PAM environment patch 49Nalin Dahyabhai <nalin.dahyabhai@pobox.com> - PAM environment patch
49Niels Kristian Bech Jensen <nkbj@image.dk> - Assorted patches 50Niels Kristian Bech Jensen <nkbj@image.dk> - Assorted patches
50Peter Kocks <peter.kocks@baygate.com> - Makefile fixes 51Peter Kocks <peter.kocks@baygate.com> - Makefile fixes
diff --git a/ChangeLog b/ChangeLog
index a14a64349..8fcf1d561 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,8 @@
120000628 120000628
2 - (djm) Fixes to lastlog code for Irix 2 - (djm) Fixes to lastlog code for Irix
3 - (djm) Use atomicio in loginrec 3 - (djm) Use atomicio in loginrec
4 - (djm) Patch from Michael Stone <mstone@cs.loyola.edu> to add support for
5 Irix 6.x array sessions, project id's, and system audit trail id.
4 6
520000627 720000627
6 - (djm) Fixes to login code - not setting li->uid, cleanups 8 - (djm) Fixes to login code - not setting li->uid, cleanups
diff --git a/acconfig.h b/acconfig.h
index 20211a0af..0a042587f 100644
--- a/acconfig.h
+++ b/acconfig.h
@@ -15,6 +15,15 @@
15/* Define if you want to enable AIX4's authenticate function */ 15/* Define if you want to enable AIX4's authenticate function */
16#undef WITH_AIXAUTHENTICATE 16#undef WITH_AIXAUTHENTICATE
17 17
18/* Define if you have/want arrays (cluster-wide session managment, not C arrays) */
19#undef WITH_IRIX_ARRAY
20
21/* Define if you want IRIX project management */
22#undef WITH_IRIX_PROJECT
23
24/* Define if you want IRIX audit trails */
25#undef WITH_IRIX_AUDIT
26
18/* Location of random number pool */ 27/* Location of random number pool */
19#undef RANDOM_POOL 28#undef RANDOM_POOL
20 29
diff --git a/configure.in b/configure.in
index ca433e569..c1bcb3424 100644
--- a/configure.in
+++ b/configure.in
@@ -90,7 +90,9 @@ case "$host" in
90 CFLAGS="$CFLAGS -I/usr/local/include" 90 CFLAGS="$CFLAGS -I/usr/local/include"
91 LDFLAGS="$LDFLAGS" 91 LDFLAGS="$LDFLAGS"
92 MANTYPE='$(CATMAN)' 92 MANTYPE='$(CATMAN)'
93 AC_MSG_WARN([*** Irix 6.x is not tested, please report you experiences *** ]) 93 AC_DEFINE(WITH_IRIX_ARRAY)
94 AC_DEFINE(WITH_IRIX_PROJECT)
95 AC_DEFINE(WITH_IRIX_AUDIT)
94 no_libsocket=1 96 no_libsocket=1
95 no_libnsl=1 97 no_libnsl=1
96 ;; 98 ;;
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 }
diff --git a/uidswap.c b/uidswap.c
index 4213d34ec..3fd0eefee 100644
--- a/uidswap.c
+++ b/uidswap.c
@@ -11,6 +11,9 @@ RCSID("$OpenBSD: uidswap.c,v 1.7 2000/06/20 01:39:45 markus Exp $");
11 11
12#include "ssh.h" 12#include "ssh.h"
13#include "uidswap.h" 13#include "uidswap.h"
14#ifdef WITH_IRIX_AUDIT
15#include <sat.h>
16#endif /* WITH_IRIX_AUDIT */
14 17
15/* 18/*
16 * Note: all these functions must work in all of the following cases: 19 * Note: all these functions must work in all of the following cases:
@@ -83,6 +86,14 @@ restore_uid()
83void 86void
84permanently_set_uid(uid_t uid) 87permanently_set_uid(uid_t uid)
85{ 88{
89#ifdef WITH_IRIX_AUDIT
90 if (sysconf(_SC_AUDIT)) {
91 debug("Setting sat id to %d", (int) uid);
92 if (satsetid(uid))
93 fatal("error setting satid: %.100s", strerror(errno));
94 }
95#endif /* WITH_IRIX_AUDIT */
96
86 if (setuid(uid) < 0) 97 if (setuid(uid) < 0)
87 debug("setuid %d: %.100s", (int) uid, strerror(errno)); 98 debug("setuid %d: %.100s", (int) uid, strerror(errno));
88} 99}