head	1.5;
access;
symbols
	RELEASE_4_5_0:1.4
	RELEASE_4_4_0:1.4
	RELEASE_4_3_0:1.4
	RELEASE_4_2_0:1.4
	RELEASE_4_1_1:1.4
	RELEASE_4_1_0:1.3
	RELEASE_3_5_0:1.3
	RELEASE_4_0_0:1.2
	RELEASE_3_4_0:1.2
	RELEASE_3_3_0:1.2
	RELEASE_3_2_0:1.1
	RELEASE_3_1_0:1.1;
locks; strict;
comment	@# @;


1.5
date	2002.02.22.02.52.25;	author knu;	state dead;
branches;
next	1.4;

1.4
date	2000.09.02.03.56.56;	author kris;	state Exp;
branches;
next	1.3;

1.3
date	2000.05.29.03.16.42;	author steve;	state Exp;
branches;
next	1.2;

1.2
date	99.06.18.20.02.27;	author ache;	state Exp;
branches;
next	1.1;

1.1
date	99.02.06.01.40.35;	author ache;	state Exp;
branches;
next	;


desc
@@


1.5
log
@- Update to 3.1.0.

  PR:		ports/34740
  Submitted by:	larse@@ISI.EDU

- Add %%PORTDOCS%% to pkg-plist.

- Assign MAINTAINER to the submitter.

  Requested by:	issei (previous MAINTAINER)
@
text
@--- lib/sshsession/sshunixuser.c.orig	Thu Aug 24 17:40:39 2000
+++ lib/sshsession/sshunixuser.c	Sun Aug 27 01:21:57 2000
@@@@ -86,6 +86,10 @@@@
 
 #define SSH_DEBUG_MODULE "SshUnixUser"
 
+#ifdef HAVE_LOGIN_CAP_H
+#include <login_cap.h>
+#endif /* HAVE_LOGIN_CAP_H */
+
 extern char *crypt(const char *key, const char *salt);
 
 /* Data type to hold machine-specific user data. */
@@@@ -1224,6 +1228,24 @@@@
   /* Set uid, gid, and groups. */
   if (getuid() == UID_ROOT || geteuid() == UID_ROOT)
     { 
+#ifdef HAVE_LOGIN_CAP_H
+    struct passwd *pwd;
+
+    pwd = getpwnam(ssh_user_name(uc));
+    if (!pwd)
+      {
+	ssh_debug("ssh_user_become: getpwnam: %s", strerror(errno));
+	return FALSE;
+      }
+    if (setusercontext(NULL, pwd, ssh_user_uid(uc),
+	LOGIN_SETALL & ~(LOGIN_SETLOGIN|LOGIN_SETPATH|LOGIN_SETENV)) != 0)
+      {
+	    ssh_debug("ssh_user_become: setusercontext: %s", strerror(errno));
+	    return FALSE;
+      }
+    endpwent();
+    endgrent();
+#else
       if (setgid(ssh_user_gid(uc)) < 0)
         {
           SSH_DEBUG(2, ("ssh_user_become: setgid: %s", strerror(errno)));
@@@@ -1280,6 +1302,7 @@@@
         }
 #endif /* HAVE_SIA */
 #endif /* SSHDIST_SESSION_SIA */
+#endif /* HAVE_LOGIN_CAP_H */
     }
   
 #ifdef KERBEROS
@


1.4
log
@Upgrade to ssh-2.3.0.

PR:	ports/20869
Submitted by:	Issei Suzuki <issei@@issei.org> (Maintainer)
@
text
@@


1.3
log
@Update to version 2.1.0pl2.

PR:		18620
Submitted by:	maintainer
@
text
@d1 3
a3 3
--- lib/sshsession/sshunixuser.c.orig	Thu Mar 30 21:41:05 2000
+++ lib/sshsession/sshunixuser.c	Wed May 17 18:15:10 2000
@@@@ -55,6 +55,10 @@@@
d14 1
a14 1
@@@@ -736,6 +740,24 @@@@
d39 1
a39 3
@@@@ -773,6 +795,7 @@@@
                         (int)ssh_user_uid(uc)));
           return FALSE;
d41 2
d46 1
a46 1
   /* We are now running with the user's privileges. */
@


1.2
log
@upgrade to 2.0.13
XXXtgetent from original PR fixed

PR: 12279
Submitted by: Issei Suzuki <issei@@issei.org>
@
text
@d1 3
a3 3
--- lib/sshsession/sshunixuser.c.orig	Tue May  4 20:09:15 1999
+++ lib/sshsession/sshunixuser.c	Fri Jun 18 16:18:08 1999
@@@@ -56,6 +56,10 @@@@
d14 1
a14 1
@@@@ -776,6 +780,24 @@@@
d39 2
a40 1
@@@@ -830,6 +852,7 @@@@
a42 1
 #endif /* HAVE_SIA */
@


1.1
log
@Use setusercontext() now to set all sort of login things including env.
variables and priority!
Enable light debugging for compatibility with -v option
Don't print "No mail." - not in BSD login style.
@
text
@d1 5
a5 5
--- lib/sshsession/sshunixuser.c.orig	Fri Jan 29 12:06:07 1999
+++ lib/sshsession/sshunixuser.c	Sat Feb  6 03:00:28 1999
@@@@ -55,6 +55,10 @@@@
 #include "tcbc2.h"
 #endif /* HAVE_OSF1_C2_SECURITY */
d14 1
a14 1
@@@@ -713,6 +717,24 @@@@
d38 2
a39 3
           ssh_debug("ssh_user_become: setgid: %s", strerror(errno));
@@@@ -745,6 +767,7 @@@@
                     (int)ssh_user_uid(uc), strerror(errno));
d42 1
d46 1
a46 1
   if (getuid() != ssh_user_uid(uc) || geteuid() != ssh_user_uid(uc))
@

