summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pool <mbp@samba.org>2002-01-24 05:57:22 +0000
committerMartin Pool <mbp@samba.org>2002-01-24 05:57:22 +0000
commit71c780da06b839598694f0bc8e2c3ccae4b29479 (patch)
tree20b5b8a793fae02d550c260b79a6e19e176434fb
parent3b18cba8890665787f035135fca9d8d9fdfd0aa0 (diff)
downloadrsync-71c780da06b839598694f0bc8e2c3ccae4b29479.tar.gz
check_name: Print out name *before* clobbering it.
-rw-r--r--socket.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/socket.c b/socket.c
index f299bc6b..e8c31012 100644
--- a/socket.c
+++ b/socket.c
@@ -710,11 +710,11 @@ int check_name(int fd,
hints.ai_socktype = SOCK_STREAM;
error = getaddrinfo(name_buf, port_buf, &hints, &res0);
if (error) {
- strcpy(name_buf, default_name);
rprintf(FERROR,
RSYNC_NAME ": forward name lookup for %s:%s failed: %s\n",
name_buf, port_buf,
gai_strerror(error));
+ strcpy(name_buf, default_name);
return error;
}
@@ -730,14 +730,14 @@ int check_name(int fd,
}
if (res == NULL) {
- strcpy(name_buf, default_name);
/* We hit the end of the list without finding an
* address that was the same as ss. */
rprintf(FERROR, RSYNC_NAME
- ": no address record for \"%s\" corresponds to address %s: "
+ ": %s is not a known address for \"%s\": "
"spoofed address?\n",
- name_buf,
- client_addr(fd));
+ client_addr(fd),
+ name_buf);
+ strcpy(name_buf, default_name);
}
freeaddrinfo(res0);