Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Jan 2001 19:34:34 -0800
From:      Dima Dorfman <dima@unixfreak.org>
To:        David Bushong <david@bushong.net>
Cc:        freebsd-stable@freebsd.org
Subject:   Re: sshd with ssh -t problems 
Message-ID:  <20010120033439.20E773E02@bazooka.unixfreak.org>
In-Reply-To: Message from David Bushong <david@bushong.net>  of "Fri, 19 Jan 2001 18:34:23 PST." <20010119183423.F16505@bushong.net> 

next in thread | previous in thread | raw e-mail | index | archive | help
> Not sure if someone else has run into this, but with 4.2-STABLE circa
> 1/16/2000's sshd I get the following behavior:
> 
> othermachine% ssh -t 4.2stable-box ls
> <login behavior>
> 4.2stable-box%

I can reproduce this.  The problem was introduced in OpenSSH 2.3.0,
which was recently MFC'd.

The patch below fixes the problem.  I did *very* little testing on it,
as the only host I have with -current (and thus, openssh 2.3.0) makes
no substansial use of ssh.

The problem is that the routine checks to see if a command was
specified so it won't do things like print the motd if you're not
running a shell, but fails to propogate it back to the rest of the
program, which then assumes none was specified.  In fact, I can't see
why it compiles without warnings in the first place: the function is
supposed to return a (char *), but the line I replaced clearly doesn't
do that.

The patch applies against src/crypto/openssh/session.c.  To get a new
sshd, you can either do a make world, or, if you don't have a fast CPU
(which I don't, FWIW), you can run `make` in src/secure/lib/libssh and
src/secure/usr.sbin/sshd, which will produce
src/secure/usr.sbin/sshd/sshd.

It would be nice if you could do some testing and report back.  If
there are no problems, I'll submit it to the OpenSSH people (if they
haven't already fixed it).

Thanks

					Dima Dorfman
					dima@unixfreak.org

Index: session.c
===================================================================
RCS file: /st/src/FreeBSD/src/crypto/openssh/session.c,v
retrieving revision 1.12
diff -u -r1.12 session.c
--- session.c	2000/12/06 10:55:44	1.12
+++ session.c	2001/01/20 03:29:26
@@ -705,7 +705,7 @@
 
 	/* Done if .hushlogin exists or a command given. */
 	if (command != NULL)
-		return;
+		return newcommand;
 	snprintf(buf, sizeof(buf), "%.200s/.hushlogin", pw->pw_dir);
 #ifdef HAVE_LOGIN_CAP
 	lc = login_getpwclass(pw);


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010120033439.20E773E02>