- (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.
This commit is contained in:
parent
53c5d467c3
commit
91606b17d2
1
CREDITS
1
CREDITS
|
@ -45,6 +45,7 @@ Kiyokazu SUTO <suto@ks-and-ks.ne.jp> - Bugfixes
|
||||||
Lutz Jaenicke <Lutz.Jaenicke@aet.TU-Cottbus.DE> - Bugfixes
|
Lutz Jaenicke <Lutz.Jaenicke@aet.TU-Cottbus.DE> - Bugfixes
|
||||||
Marc G. Fournier <marc.fournier@acadiau.ca> - Solaris patches
|
Marc G. Fournier <marc.fournier@acadiau.ca> - Solaris patches
|
||||||
Matt Richards <v2matt@btv.ibm.com> - AIX patches
|
Matt Richards <v2matt@btv.ibm.com> - AIX patches
|
||||||
|
Michael Stone <mstone@cs.loyola.edu> - Irix enhancements
|
||||||
Nalin Dahyabhai <nalin.dahyabhai@pobox.com> - PAM environment patch
|
Nalin Dahyabhai <nalin.dahyabhai@pobox.com> - PAM environment patch
|
||||||
Niels Kristian Bech Jensen <nkbj@image.dk> - Assorted patches
|
Niels Kristian Bech Jensen <nkbj@image.dk> - Assorted patches
|
||||||
Peter Kocks <peter.kocks@baygate.com> - Makefile fixes
|
Peter Kocks <peter.kocks@baygate.com> - Makefile fixes
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
20000628
|
20000628
|
||||||
- (djm) Fixes to lastlog code for Irix
|
- (djm) Fixes to lastlog code for Irix
|
||||||
- (djm) Use atomicio in loginrec
|
- (djm) Use atomicio in loginrec
|
||||||
|
- (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.
|
||||||
|
|
||||||
20000627
|
20000627
|
||||||
- (djm) Fixes to login code - not setting li->uid, cleanups
|
- (djm) Fixes to login code - not setting li->uid, cleanups
|
||||||
|
|
|
@ -15,6 +15,15 @@
|
||||||
/* Define if you want to enable AIX4's authenticate function */
|
/* Define if you want to enable AIX4's authenticate function */
|
||||||
#undef WITH_AIXAUTHENTICATE
|
#undef WITH_AIXAUTHENTICATE
|
||||||
|
|
||||||
|
/* Define if you have/want arrays (cluster-wide session managment, not C arrays) */
|
||||||
|
#undef WITH_IRIX_ARRAY
|
||||||
|
|
||||||
|
/* Define if you want IRIX project management */
|
||||||
|
#undef WITH_IRIX_PROJECT
|
||||||
|
|
||||||
|
/* Define if you want IRIX audit trails */
|
||||||
|
#undef WITH_IRIX_AUDIT
|
||||||
|
|
||||||
/* Location of random number pool */
|
/* Location of random number pool */
|
||||||
#undef RANDOM_POOL
|
#undef RANDOM_POOL
|
||||||
|
|
||||||
|
|
|
@ -90,7 +90,9 @@ case "$host" in
|
||||||
CFLAGS="$CFLAGS -I/usr/local/include"
|
CFLAGS="$CFLAGS -I/usr/local/include"
|
||||||
LDFLAGS="$LDFLAGS"
|
LDFLAGS="$LDFLAGS"
|
||||||
MANTYPE='$(CATMAN)'
|
MANTYPE='$(CATMAN)'
|
||||||
AC_MSG_WARN([*** Irix 6.x is not tested, please report you experiences *** ])
|
AC_DEFINE(WITH_IRIX_ARRAY)
|
||||||
|
AC_DEFINE(WITH_IRIX_PROJECT)
|
||||||
|
AC_DEFINE(WITH_IRIX_AUDIT)
|
||||||
no_libsocket=1
|
no_libsocket=1
|
||||||
no_libnsl=1
|
no_libnsl=1
|
||||||
;;
|
;;
|
||||||
|
|
26
session.c
26
session.c
|
@ -28,6 +28,10 @@ RCSID("$OpenBSD: session.c,v 1.20 2000/06/18 04:42:54 markus Exp $");
|
||||||
#include "auth.h"
|
#include "auth.h"
|
||||||
#include "auth-options.h"
|
#include "auth-options.h"
|
||||||
|
|
||||||
|
#ifdef WITH_IRIX_PROJECT
|
||||||
|
#include <proj.h>
|
||||||
|
#endif /* WITH_IRIX_PROJECT */
|
||||||
|
|
||||||
/* types */
|
/* types */
|
||||||
|
|
||||||
#define TTYSZ 64
|
#define TTYSZ 64
|
||||||
|
@ -799,6 +803,9 @@ do_child(const char *command, struct passwd * pw, const char *term,
|
||||||
extern char **environ;
|
extern char **environ;
|
||||||
struct stat st;
|
struct stat st;
|
||||||
char *argv[10];
|
char *argv[10];
|
||||||
|
#ifdef WITH_IRIX_PROJECT
|
||||||
|
prid_t projid;
|
||||||
|
#endif /* WITH_IRIX_PROJECT */
|
||||||
|
|
||||||
/* login(1) is only called if we execute the login shell */
|
/* login(1) is only called if we execute the login shell */
|
||||||
if (options.use_login && command != NULL)
|
if (options.use_login && command != NULL)
|
||||||
|
@ -836,6 +843,25 @@ do_child(const char *command, struct passwd * pw, const char *term,
|
||||||
}
|
}
|
||||||
endgrent();
|
endgrent();
|
||||||
|
|
||||||
|
#ifdef WITH_IRIX_ARRAY
|
||||||
|
/* initialize array session */
|
||||||
|
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 */
|
||||||
|
|
||||||
/* Permanently switch to the desired uid. */
|
/* Permanently switch to the desired uid. */
|
||||||
permanently_set_uid(pw->pw_uid);
|
permanently_set_uid(pw->pw_uid);
|
||||||
}
|
}
|
||||||
|
|
11
uidswap.c
11
uidswap.c
|
@ -11,6 +11,9 @@ RCSID("$OpenBSD: uidswap.c,v 1.7 2000/06/20 01:39:45 markus Exp $");
|
||||||
|
|
||||||
#include "ssh.h"
|
#include "ssh.h"
|
||||||
#include "uidswap.h"
|
#include "uidswap.h"
|
||||||
|
#ifdef WITH_IRIX_AUDIT
|
||||||
|
#include <sat.h>
|
||||||
|
#endif /* WITH_IRIX_AUDIT */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Note: all these functions must work in all of the following cases:
|
* Note: all these functions must work in all of the following cases:
|
||||||
|
@ -83,6 +86,14 @@ restore_uid()
|
||||||
void
|
void
|
||||||
permanently_set_uid(uid_t uid)
|
permanently_set_uid(uid_t uid)
|
||||||
{
|
{
|
||||||
|
#ifdef WITH_IRIX_AUDIT
|
||||||
|
if (sysconf(_SC_AUDIT)) {
|
||||||
|
debug("Setting sat id to %d", (int) uid);
|
||||||
|
if (satsetid(uid))
|
||||||
|
fatal("error setting satid: %.100s", strerror(errno));
|
||||||
|
}
|
||||||
|
#endif /* WITH_IRIX_AUDIT */
|
||||||
|
|
||||||
if (setuid(uid) < 0)
|
if (setuid(uid) < 0)
|
||||||
debug("setuid %d: %.100s", (int) uid, strerror(errno));
|
debug("setuid %d: %.100s", (int) uid, strerror(errno));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue