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]

openSSH under cygwin fix

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:

  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 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
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.


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]