Doesn't this work?

Place these lines in your .cshrc before anything that would cause a
problem, such as `echo ...`

#       Exit now if not interactive shell
if (! $?prompt || ! $?USER) exit

-P.

******************************************************************************
Phil Hurvitz, MFR | GIS Specialist | College of Forest Resources | 355 Bloedel
Box 352100 | University of Washington, Seattle, Washington  98195-2100, USA
 tel: 206.685.8179 | FAX: 206.685.3091 | e-mail: [EMAIL PROTECTED] 
             WWW: http://lobo.cfr.washington.edu/phurvitz/
******************************************************************************

---------- Forwarded message ----------
Date: Tue, 9 May 2000 08:23:11 +0300 (EEST)
From: Sami Lehtinen <[EMAIL PROTECTED]>
To: Ray Daoud <[EMAIL PROTECTED]>
Cc: [EMAIL PROTECTED], [EMAIL PROTECTED], Jacek Slaboszewicz <[EMAIL PROTECTED]>
Subject: Re: Windows Client SFTP

Ray Daoud writes:
  : On Tue, 9 May 2000, Sami Lehtinen wrote:
  : > sh, bash and zsh (I presume ksh also behaves like this) don't source
  : > their rc-files, if they are non-interactive (ie. executing command).
  : > 
  : > tcsh (atleast, and very probably csh (I can't verify this right this
  : > minute)) source their rc-files even if non-interactive. If they are
  : > given the argument "-f", they won't read the dot-rc files at startup.
  : 
  : Yep, csh does this as well...
  : 
  : > Suggestions? Should I check if the shell is "*csh" and give the
  : > argument "-f", if executing a command?
  : 
  : That was exactly what I was thinking. I tried "csh -f" wrapper
  : script to call from sshd2_config, but apparently the damage is done
  : before the sftp-server process is called...

That wouldn't work. The sftp-server (or whatever sub-system you're
running) is executed with execve() in the following manner:

% <user-shell> -c <sub-system>

ad indeed, tcsh and csh have already destroyed the filexfer protocol
stream. (as in "outputted junk to it...")

  : A patch for this would be _much_ appreciated...

I'll see what we can cook up.

Hmm, and of course this behaviour should be configurable... *sigh*

-- 
[[EMAIL PROTECTED]          --  Sami J. Lehtinen  --           [EMAIL PROTECTED]]
[work:+358 9 85657425][gsm:+358 50 5170 258][http://www.iki.fi/~sjl]
[SSH Communications Security Ltd.               http://www.ssh.com/]

Reply via email to