This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: openSSH under cygwin fix

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 ===
         * The Windows environment contains some setting which are
         * important for a running system. They must not be dropped.
        copy_environment(&env, &envsize);
=== 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 I'm trying to avoid any special
Cygwin code which is not in the official sources.


Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                      
Red Hat, Inc.

Want to unsubscribe from this list?
Check out:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]