Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <3C1F738E.F3D173F1@gte.net> Date: Tue, 18 Dec 2001 08:49:18 -0800 From: David Rothenberger X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 To: Corinna Vinschen Subject: Re: path problems when logged in through ssh References: <4 DOT 3 DOT 1 DOT 2 DOT 20011217112036 DOT 0223c410 AT pop DOT ma DOT ultranet DOT com> <003901c18736$7c4a4370$738ffe0c AT pwork> <3C1E58F9 DOT 27125FFC AT verizon DOT net> <20011218130612 DOT W21898 AT cygbert DOT vinschen DOT de> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Corinna Vinschen wrote: > > On Mon, Dec 17, 2001 at 12:43:37PM -0800, David Rothenberger wrote: > > I had a similar problem with ssh. In my case, I couldn't even log in > > through ssh because the spawned child process could not find the cygwin > > DLL. The problem was that my system PATH value was longer than 512 > > characters. > > > > The sshd daemon is supposed to copy its environment for the child > > process. Through debugging, I determined the child process did get a > > copy of the daemon's environment -- except for PATH, which was set to > > some useless default like /usr/sbin:/c/WINNT that didn't include the > > cygwin directory. > > > > I looked at the sshd sources and noticed a limit on the environment > > value sizes of 512 in the code that copies the environment. Since > > shortening my system PATH value was not an option, I solved the problem > > by overriding the PATH value for the sshd daemon's environment. I did > > this by editing the registry for my sshd service, but you can also do it > > by recreating the sshd service with cygrunsrv and specifying the PATH > > value as part of the service's environment. > > Just to claify here. You're not talking about OpenSSH but of ssh.com, > right? There's no limit of the length of environment variables in > OpenSSH nor is PATH truncated to some default value in thr Cygwin version. No, I was talking about OpenSSH, not ssh.com. I saw this behavior on a machine with a PATH of about 600 characters. When I tried to connect to the server (with either openssh client or ssh.com), I got a Windows dialog saying that the cygwin1.dll couldn't be found in the path c:\cygwin\usr\sbin;c:\winnt;c:\winnt\system32... Setting PATH in the environment for the sshd process fixed the problem. I was running the same setup on two machines. The one with the shorter path worked fine, the one with the longer path did not. I thought there was a limit because the char[] array for the environment value in copyEnvironment() was 512. (This is from memory, so I may be a little off here.) I'll try to do some more investigation and experimentation this evening to see if I can isolate the problem further. Dave P.S. This occurred a couple weeks ago, with the OpenSSH package released before the current one. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/