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


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

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

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

1.3
date	99.06.18.20.02.26;	author ache;	state Exp;
branches;
next	1.2;

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

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


desc
@@


1.6
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
@--- apps/ssh/sshchsession.c.orig	Thu Aug 24 17:40:41 2000
+++ apps/ssh/sshchsession.c	Sun Aug 27 01:16:55 2000
@@@@ -83,6 +83,11 @@@@
 #include <ulimit.h>
 #endif /* ULIMIT_H */
 
+#ifdef HAVE_LOGIN_CAP_H
+#include <login_cap.h>
+extern char **environ;
+#endif
+
 #define SSH_DEBUG_MODULE "Ssh2ChannelSession"
 
 #define SSH_SESSION_INTERACTIVE_WINDOW                 10000
@@@@ -489,6 +494,67 @@@@
   if (getenv("TZ"))
     ssh_child_set_env(envp, envsizep, "TZ", getenv("TZ"));
 
+#ifdef HAVE_LOGIN_CAP_H
+   {
+    char *p, *s, **tmpenv;
+    struct passwd *pwd;
+
+    pwd = getpwnam(user_name);
+    if (!pwd)
+      {
+	ssh_warning("Can't getpwnam %s: %s", user_name, strerror(errno));
+      }
+    else
+      {
+      /* Save previous environment array
+       */
+      tmpenv = environ;
+      environ = *envp;
+
+      /* Set the user's login environment
+       */
+      if (setusercontext(NULL, pwd,
+			 ssh_user_uid(session->common->user_data),
+			 LOGIN_SETPATH|LOGIN_SETENV) == 0)
+	{
+	  p = getenv("PATH");
+	  s = ssh_xmalloc((p != NULL ? strlen(p) + 1 : 0)
+			  + sizeof(SSH_BINDIR));
+	  *s = '\0';
+	  if (p != NULL)
+	    {
+	      strcat(s, p);
+	      strcat(s, ":");
+	    }
+	  strcat(s, SSH_BINDIR);
+
+	  /* copy enviroment variables to (*envp) */
+	  for (i = 0; environ[i] != NULL; i++)
+	      ;
+	  (*envp) = ssh_xmalloc((i + 51) * sizeof(char *));
+          (*envsizep) = i + 50;
+
+	  for (i = 0; environ[i] != NULL; ++i) {
+	      (*envp)[i] = ssh_xmalloc((strlen(environ[i]) + 1) * sizeof(char));
+	      strcpy((*envp)[i], environ[i]);
+	  }
+	  (*envp)[i] = NULL;
+
+	  environ = tmpenv; /* Restore parent environment */
+	  ssh_child_set_env(envp, envsizep, "PATH", s);
+	  ssh_xfree(s);
+	}
+      else
+	{
+	  *envp = environ;
+	  environ = tmpenv; /* Restore parent environment */
+	  ssh_warning("Can't setusercontext env. variables: %s", strerror(errno));
+	}
+      }
+    endpwent();
+  }
+#endif /* HAVE_LOGIN_CAP_H */
+
   /* Set SSH_CLIENT. */
   snprintf(buf, sizeof(buf), "%s %s %s %s",
            session->common->remote_ip, session->common->remote_port,
@@@@ -729,12 +795,20 @@@@
   char buff[100], *time_string;
 
   /* Check /etc/nologin. */
+#ifdef __FreeBSD__
+  f = fopen("/var/run/nologin", "r");
+#else
   f = fopen("/etc/nologin", "r");
+#endif
   if (f)
     { /* /etc/nologin exists.  Print its contents and exit. */
       /* Print a message about /etc/nologin existing; I am getting
          questions because of this every week. */
+#ifdef __FreeBSD__
+      ssh_warning("Logins are currently denied by /var/run/nologin:");
+#else
       ssh_warning("Logins are currently denied by /etc/nologin:");
+#endif
       while (fgets(buf, sizeof(buf), f))
         fputs(buf, stderr);
       fclose(f);
@@@@ -918,7 +992,11 @@@@
                   {
                     struct stat mailbuf;
                     if (stat(mailbox, &mailbuf) == -1 || mailbuf.st_size == 0)
+#ifndef __FreeBSD__
                       printf("No mail.\n");
+#else
+                      ;
+#endif
                     else if (mailbuf.st_atime > mailbuf.st_mtime)
                       printf("You have mail.\n");
                     else
@


1.5
log
@Upgrade to ssh-2.3.0.

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


1.4
log
@Update to version 2.1.0pl2.

PR:		18620
Submitted by:	maintainer
@
text
@d1 3
a3 3
--- apps/ssh/sshchsession.c.orig	Wed May 17 18:01:34 2000
+++ apps/ssh/sshchsession.c	Wed May 17 18:11:14 2000
@@@@ -77,6 +77,11 @@@@
d15 1
a15 1
@@@@ -483,6 +488,67 @@@@
d83 1
a83 1
@@@@ -710,12 +776,20 @@@@
d85 1
a85 1
   
d104 1
a104 1
@@@@ -878,7 +952,11 @@@@
@


1.3
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
--- apps/ssh/sshchsession.c.orig	Fri May  7 20:02:03 1999
+++ apps/ssh/sshchsession.c	Sat Jun 19 03:51:31 1999
@@@@ -81,6 +81,11 @@@@
d15 1
a15 1
@@@@ -406,6 +411,67 @@@@
d83 1
a83 1
@@@@ -633,12 +699,20 @@@@
d104 1
a104 1
@@@@ -789,7 +863,11 @@@@
@


1.2
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 3
a3 3
--- apps/ssh/sshchsession.c.orig	Mon Jan 18 13:32:24 1999
+++ apps/ssh/sshchsession.c	Sat Feb  6 04:20:26 1999
@@@@ -80,6 +80,11 @@@@
d15 1
a15 1
@@@@ -405,6 +410,62 @@@@
d53 12
a64 1
+	  *envp = environ;
a65 6
+	  for (*envsizep = 0; (*envp)[*envsizep] != NULL; (*envsizep)++)
+	    ;
+	  (*envsizep)++;
+          (*envsizep) += 50;
+	  (*envp) = ssh_xrealloc(*envp, (*envsizep) * sizeof(char *));
+
d83 1
a83 1
@@@@ -628,12 +689,20 @@@@
d104 4
a107 4
@@@@ -754,7 +823,11 @@@@
           {
             struct stat mailbuf;
             if (stat(mailbox, &mailbuf) == -1 || mailbuf.st_size == 0)
d109 1
a109 1
               printf("No mail.\n");
d111 1
a111 1
+	      ;
d113 3
a115 3
             else if (mailbuf.st_atime > mailbuf.st_mtime)
               printf("You have mail.\n");
             else
@


1.1
log
@upgrade to 2.0.12
@
text
@d1 78
a78 3
--- apps/ssh/sshchsession.c.bak	Mon Jan 18 13:32:24 1999
+++ apps/ssh/sshchsession.c	Fri Feb  5 08:49:14 1999
@@@@ -628,12 +628,20 @@@@
d99 12
@

