SSH_CLIENT _not_ set when doing a command

Daniel Saakes daniels at dds.nl
Fri Sep 29 00:50:28 EST 2000


Hi,
we (sendy & me) think it is a bash problem.

i'm testing on a debian woody i386 system. 

bash-2.04$ ssh localhost 'env | grep SSH'
daniel at localhost's password: 
SSH_AUTH_SOCK=/tmp/ssh-IcJ10349/agent.10349

so i made a small test program:
--- code ---
#include <stdio.h>
#include <unistd.h>

int main()
{
  char *argv[3];
  char *env[2];

  env[0] = "SSH_WHATEVER=OK";
  env[1] = "SSH_CLIENT=127.0.0.1 929 22";
  env[2] = NULL;
  argv[0] = "-bash";
  argv[1] = NULL;

  execve("/bin/bash", argv, env);
  return 0;
}
--- end code ---
in this program the SSH_CLIENT doesn't show up either:
bash-2.04$ ./test
daniel at this:/usr/local/src/test-execve$ env | grep SSH
SSH_WHATEVER=OK

if i change the shell in the program to "/bin/ash" (or "/bin/csh") everything is ok:
bash-2.04$ ./test
$ env | grep SSH
SSH_CLIENT=127.0.0.1 929 22
SSH_WHATEVER=OK

In the bash source the SSH_CLIENT is treated as a 'special variable' and if we remove this treatment the patched bash version works ok with sshd. So i have mailed the debian bash maintainer about it

in the meantime we use the ash shell for our dynamic dns system, which works allright

regards,
Daniel Saakes

 





More information about the openssh-unix-dev mailing list