Diff for /embedaddon/rsync/clientname.c between versions 1.1.1.1 and 1.1.1.2

version 1.1.1.1, 2012/02/17 15:09:30 version 1.1.1.2, 2013/10/14 07:51:14
Line 3 Line 3
  *   *
  * Copyright (C) 1992-2001 Andrew Tridgell <tridge@samba.org>   * Copyright (C) 1992-2001 Andrew Tridgell <tridge@samba.org>
  * Copyright (C) 2001, 2002 Martin Pool <mbp@samba.org>   * Copyright (C) 2001, 2002 Martin Pool <mbp@samba.org>
 * Copyright (C) 2002-2009 Wayne Davison * Copyright (C) 2002-2013 Wayne Davison
  *   *
  * This program is free software; you can redistribute it and/or modify   * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by   * it under the terms of the GNU General Public License as published by
Line 41  char *client_addr(int fd) Line 41  char *client_addr(int fd)
         static int initialised;          static int initialised;
         struct sockaddr_storage ss;          struct sockaddr_storage ss;
         socklen_t length = sizeof ss;          socklen_t length = sizeof ss;
         char *ssh_info, *p;  
   
         if (initialised)          if (initialised)
                 return addr_buf;                  return addr_buf;
Line 49  char *client_addr(int fd) Line 48  char *client_addr(int fd)
         initialised = 1;          initialised = 1;
   
         if (am_server) {        /* daemon over --rsh mode */          if (am_server) {        /* daemon over --rsh mode */
                   char *env_str;
                 strlcpy(addr_buf, "0.0.0.0", sizeof addr_buf);                  strlcpy(addr_buf, "0.0.0.0", sizeof addr_buf);
                if ((ssh_info = getenv("SSH_CONNECTION")) != NULL                if ((env_str = getenv("REMOTE_HOST")) != NULL
                    || (ssh_info = getenv("SSH_CLIENT")) != NULL                 || (env_str = getenv("SSH_CONNECTION")) != NULL
                    || (ssh_info = getenv("SSH2_CLIENT")) != NULL) {                 || (env_str = getenv("SSH_CLIENT")) != NULL
                        strlcpy(addr_buf, ssh_info, sizeof addr_buf);                 || (env_str = getenv("SSH2_CLIENT")) != NULL) {
                         char *p;
                         strlcpy(addr_buf, env_str, sizeof addr_buf);
                         /* Truncate the value to just the IP address. */                          /* Truncate the value to just the IP address. */
                         if ((p = strchr(addr_buf, ' ')) != NULL)                          if ((p = strchr(addr_buf, ' ')) != NULL)
                                 *p = '\0';                                  *p = '\0';

Removed from v.1.1.1.1  
changed lines
  Added in v.1.1.1.2


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>