summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2001-02-16 12:12:41 +1100
committerDamien Miller <djm@mindrot.org>2001-02-16 12:12:41 +1100
commit217f567187a9b1d32019666151d702c87332c72b (patch)
treefaa72af41f566ce6ba47cb1540c7a757e02a7333
parent5dfe976cdfbc5703dfbbd0783f1328be0007eca3 (diff)
- (djm) Set "login ID" on systems with setluid. Only enabled for SCO
OpenServer for now. Based on patch from svaughan <svaughan@asterion.com>
-rw-r--r--ChangeLog4
-rw-r--r--configure.in5
-rw-r--r--session.c7
3 files changed, 12 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index e389cfc0..83677c0e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,8 @@
- (djm) USE_PIPES for a few more sysv platforms
- (djm) Cleanup configure.in a little
- (djm) Ask users to check config.log when we can't find necessary libs
+ - (djm) Set "login ID" on systems with setluid. Only enabled for SCO
+ OpenServer for now. Based on patch from svaughan <svaughan@asterion.com>
20010215
- (djm) Move PAM session setup back to before setuid to user. Fixes
@@ -3984,4 +3986,4 @@
- Wrote replacements for strlcpy and mkdtemp
- Released 1.0pre1
-$Id: ChangeLog,v 1.777 2001/02/16 01:05:39 djm Exp $
+$Id: ChangeLog,v 1.778 2001/02/16 01:12:41 djm Exp $
diff --git a/configure.in b/configure.in
index ac9a456a..2104329c 100644
--- a/configure.in
+++ b/configure.in
@@ -1,4 +1,4 @@
-# $Id: configure.in,v 1.242 2001/02/16 01:05:39 djm Exp $
+# $Id: configure.in,v 1.243 2001/02/16 01:12:41 djm Exp $
AC_INIT(ssh.c)
@@ -236,6 +236,7 @@ mips-sony-bsd|mips-sony-newsos4)
AC_DEFINE(HAVE_SCO_PROTECTED_PW)
AC_DEFINE(DISABLE_SHADOW)
AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
+ AC_CHECK_FUNCS(getluid setluid)
;;
*-*-sco3.2v5*)
CPPFLAGS="$CPPFLAGS -I/usr/local/include"
@@ -249,9 +250,9 @@ mips-sony-bsd|mips-sony-newsos4)
AC_DEFINE(HAVE_SCO_PROTECTED_PW)
AC_DEFINE(DISABLE_SHADOW)
AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
+ AC_CHECK_FUNCS(getluid setluid)
;;
*-dec-osf*)
-# This is untested
if test ! -z "USE_SIA" ; then
AC_MSG_CHECKING(for Digital Unix Security Integration Architecture)
if test -f /etc/sia/matrix.conf; then
diff --git a/session.c b/session.c
index 8f3ee834..47ef8b9c 100644
--- a/session.c
+++ b/session.c
@@ -881,7 +881,6 @@ void do_pam_environment(char ***env, int *envsize)
}
#endif /* USE_PAM */
-
#ifdef HAVE_CYGWIN
void copy_environment(char ***env, int *envsize)
{
@@ -1118,6 +1117,12 @@ do_child(const char *command, struct passwd * pw, const char *term,
}
#endif /* HAVE_OSF_SIA */
+#if defined(HAVE_GETLUID) && defined(HAVE_SETLUID)
+ /* Sets login uid for accounting */
+ if (getluid() == -1 && setluid(pw->pw_uid) == -1)
+ error("setluid: %s", strerror(errno));
+#endif /* defined(HAVE_GETLUID) && defined(HAVE_SETLUID) */
+
#ifdef HAVE_CYGWIN
if (is_winnt)
#endif