diff options
author | Wayne Davison <wayned@samba.org> | 2013-07-12 15:24:58 -0700 |
---|---|---|
committer | Wayne Davison <wayned@samba.org> | 2013-07-12 15:24:58 -0700 |
commit | 99c9520ea735d3fa72721c534a5e3b25751e0203 (patch) | |
tree | 6c858ef90fcc11a763c6d80ea277ba85fcbe9faf | |
parent | 01959d6387eb1eed344d9e905cab2e2d59e5bc74 (diff) | |
download | rsync-99c9520ea735d3fa72721c534a5e3b25751e0203.tar.gz rsync-99c9520ea735d3fa72721c534a5e3b25751e0203.tar.bz2 rsync-99c9520ea735d3fa72721c534a5e3b25751e0203.zip |
Look for REMOTE_HOST before SSH_* environment options.
-rw-r--r-- | clientname.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clientname.c b/clientname.c index d085fc78..935d2d61 100644 --- a/clientname.c +++ b/clientname.c @@ -50,10 +50,10 @@ char *client_addr(int fd) if (am_server) { /* daemon over --rsh mode */ char *env_str; strlcpy(addr_buf, "0.0.0.0", sizeof addr_buf); - if ((env_str = getenv("SSH_CONNECTION")) != NULL + if ((env_str = getenv("REMOTE_HOST")) != NULL + || (env_str = getenv("SSH_CONNECTION")) != NULL || (env_str = getenv("SSH_CLIENT")) != NULL - || (env_str = getenv("SSH2_CLIENT")) != NULL - || (env_str = getenv("REMOTE_HOST")) != NULL) { + || (env_str = getenv("SSH2_CLIENT")) != NULL) { char *p; strlcpy(addr_buf, env_str, sizeof addr_buf); /* Truncate the value to just the IP address. */ |