From owner-freebsd-stable Fri Jan 19 19:35: 1 2001 Delivered-To: freebsd-stable@freebsd.org Received: from bazooka.unixfreak.org (bazooka.unixfreak.org [63.198.170.138]) by hub.freebsd.org (Postfix) with ESMTP id 3E41837B400 for ; Fri, 19 Jan 2001 19:34:43 -0800 (PST) Received: by bazooka.unixfreak.org (Postfix, from userid 1000) id 20E773E02; Fri, 19 Jan 2001 19:34:39 -0800 (PST) Received: from unixfreak.org (localhost [127.0.0.1]) by bazooka.unixfreak.org (Postfix) with ESMTP id 1A3133C10A; Fri, 19 Jan 2001 19:34:39 -0800 (PST) To: David Bushong Cc: freebsd-stable@freebsd.org Subject: Re: sshd with ssh -t problems In-Reply-To: Message from David Bushong of "Fri, 19 Jan 2001 18:34:23 PST." <20010119183423.F16505@bushong.net> Date: Fri, 19 Jan 2001 19:34:34 -0800 From: Dima Dorfman Message-Id: <20010120033439.20E773E02@bazooka.unixfreak.org> Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > 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 > > 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