delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/04/25/10:48:08

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
X-Originating-IP: [24.0.161.175]
From: "Karl M" <karlm30 AT hotmail DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: openSSH under cygwin fix
Date: Wed, 25 Apr 2001 07:20:06 -0700
Mime-Version: 1.0
Message-ID: <F214iFC1c0xJK5OuLID000092aa@hotmail.com>
X-OriginalArrivalTime: 25 Apr 2001 14:20:06.0935 (UTC) FILETIME=[D3D69A70:01C0CD92]

Hi Corinna...

But when the process is spawned, it has the environment of SYSTEM or the 
user running the sshd daemon instead of the target user. Is it possible to 
change that?

For now, I just set the ~/.ssh/environment to fix things up. But that 
requires maintaining two copies of my environment definitions...one for 
win2k and one for sshd.

Thanks,

...Karl


>From: Corinna Vinschen <cygwin AT cygwin DOT com>
>To: cygwin AT sources DOT redhat DOT com
>Subject: Re: openSSH under cygwin fix
>Date: Wed, 25 Apr 2001 15:08:13 +0200
>
>On Wed, Apr 25, 2001 at 01:41:19PM +0100, Gaz Jones wrote:
> > Hi, first, thanks for the great cygwin and for the work on
> > the openSSH port. I _think_ I may have found a problem (I
> > may not have, have only been playing around with the
> > code so far :), in that the PATH under Windows doesn't
> > seem to be getting set after I log in. The relevant
> > lines are in session.c (1205 - 1213):
> >
> > # ifndef HAVE_CYGWIN
> >   /*
> >    * There's no standard path on Windows. The path contains
> >    * important components pointing to the system directories,
> >    * needed for loading shared libraries. So the path better
> >    * remains intact here.
> >    */
> >   child_set_env(&env, &envsize, "PATH", _PATH_STDPATH);
> > # endif /* HAVE_CYGWIN */
> >
> > Changing the # endif line to:
> >
> > #else
> >   child_set_env(&env, &envsize, "PATH", getenv("PATH"));
> > #endif /* HAVE_CYGWIN */
> >
> > fixes this. This could be a result of my setting up a very bare
> > bones cygwin setup (testing to see how little I need to have a
> > running SSH setup) and using cmd.exe as my shell.
>
>I appreciate your effort but I'm surprised that your above
>fix should change anything.  If you examine session.c again,
>you will find a few lines above the following code:
>
>=== SNIP ===
>#ifdef HAVE_CYGWIN
>         /*
>          * The Windows environment contains some setting which are
>          * important for a running system. They must not be dropped.
>          */
>         copy_environment(&env, &envsize);
>#endif
>=== SNAP ===
>
>This code copies the whole environment. Call `ssh -v'. That will
>print the environment which is inherited to the shell. You will
>have to start sshd with -d option, though.
>
> > I also found that when using sftp-server, if you didn't use
> > sh (or a typical UNIX shell I assume), I couldn't sftp to the
> > server - to fix this I added some code that would check for
>
>Yep, that's a cmd problem. Any UNIX shell works.
>
> > an environment variable called NEWSHELL and would use that
> > as the shell if it was specified. Hence, when using sftp I
> > can use sh, but with SSH I can use cmd.exe. I can mail the
> > few extra lines of code for this if you want.
>
>Hmm, I'm not quite sure if the OpenSSH maintainers will like
>that patch. If you really want to get it into the official
>OpenSSH sources I suggest sending the patch to the mailing list
>openssh-unix-dev AT mindrot DOT org. I'm trying to avoid any special
>Cygwin code which is not in the official sources.
>
>Corinna
>
>--
>Corinna Vinschen                  Please, send mails regarding Cygwin to
>Cygwin Developer                                mailto:cygwin AT cygwin DOT com
>Red Hat, Inc.
>
>--
>Want to unsubscribe from this list?
>Check out: http://cygwin.com/ml/#unsubscribe-simple
>

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com


--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019